need syntax help

T

ToddAndMargo

Hi All,

I was over at
http://search.cpan.org/~fkolodny/Net-Rexec-0.12/Rexec.pm
looking at the rexec example. (I have rexec working on a server I want
to read the tape drive status off of.)

Okay, I know, just try it an see, but I will not be out to the
location for a while and I was hoping someone would put
me out of my ignorance

Syntax question: how do I enter "mt -f /dev/st0 status; grep -i
online"
into the "command" field below? Do I put quotes around it?
How do I separate my command from the "userid" and
"password"? I am concerned that the line below will
confuse "-f" for the userid, etc..

use Net::Rexec 'rexec';
($rc, @output) = rexec(host, command, [userid, [password]]);

Many thanks,
--T
 
B

Bob Walton

Syntax question: how do I enter "mt -f /dev/st0 status; grep -i
online"
into the "command" field below? Do I put quotes around it?

Um, it already has quotes around it as you show it above. That should
do nicely, except you probably don't want the newline.
How do I separate my command from the "userid" and
"password"? I am concerned that the line below will
confuse "-f" for the userid, etc..

Um, with the commas shown. You're making it too hard. I assume the
arguments are all supposed to be strings, so each argument should be an
expression which evaluates to a string. Specifically they should not be
barewords as shown in the description below. An example might be:
($rc,@output)=rexec('my_host',
'mt -f /dev/st0 status; grep -i online',
'my_userID','my_password');
or, if those things were all defined as variables:
($rc,@output)=rexec($host,$command,$userID,$pw);
use Net::Rexec 'rexec';
($rc, @output) = rexec(host, command, [userid, [password]]); ....
--T
 
V

vjp2.at

Mind if I piggyback a request here? (pls cc email)

Two years ago, someone wrote me this PERL script on a piece of
scrap paper and I had difficulty figuring out some of the writting.

esp: is that x or *???

perl -pe 'if ($.%4==2){$_.="-" x 37} elseif {$.%4==0) {$_.="=" x 37} $_.="\n"'
< %1 >%1


Then I want to make it double spaced.
Every second blank (fourth of the total) line should then
be replace with a line of 37 "-" characters..
and then every second dashed line (every fourth blank aka every eighth
actual) should be replace wit a line of 37 "=" characters..

This script does not have fold/justify at col 37,
but it would be nice if it did.

Much obliged.
 
P

Paul Lalli

Mind if I piggyback a request here?

Yes. I do. There is no reason to post this message in an existing
thread. Start a new topic.
(pls cc email)

No. You posted the message here, you read the responses here.
Two years ago, someone wrote me this PERL

Perl. Not PERL.
script on a piece of
scrap paper and I had difficulty figuring out some of the writting.

esp: is that x or *???

What happened when you tried each? Did one "work" while the other
didn't?

Do you know the difference between the two operators? You can look
them up in
perldoc perlop
perl -pe 'if ($.%4==2){$_.="-" x 37} elseif {$.%4==0) {$_.="=" x 37} $_.="\n"'
< %1 >%1


Then I want to make it double spaced.
Every second blank (fourth of the total) line should then
be replace with a line of 37 "-" characters..
and then every second dashed line (every fourth blank aka every eighth
actual) should be replace wit a line of 37 "=" characters..

This script does not have fold/justify at col 37,
but it would be nice if it did.

What have you tried so far, and how did it not work the way you wanted?

Paul Lalli
 
T

Tad McClellan

Mind if I piggyback a request here?

yes.


(pls cc email)

no.


Two years ago, someone wrote me this PERL script


It is not a Perl, nor perl, nor PERL script...

esp: is that x or *???


The x operator is described in:

perldoc perlop

perl -pe 'if ($.%4==2){$_.="-" x 37} elseif {$.%4==0) {$_.="=" x 37} $_.="\n"'
^^^^^^ ^
^^^^^^ ^

Perl does not have an "elseif" keyword. It does have an "elsif"
keyword though.

The condition must be in properly balanced parenthesis.
 
U

Uri Guttman

b> Paul Lalli wrote:

b> You are a spectacular asshole.

b> Then why do *you* spell it PERL here?

b> http://cgi2.cs.rpi.edu/~lallip/perl/spring06/index.shtml

b> Dumbshit.

me thinks you are the dumber shit. that is either a font style that
doesn't have lower case or a graphic style. notice just next to it there
is 'Perl Quotes'.

now that you have shown yourself to be a useless jerk, please go learn
python and bother them. you have no reason to be here.

uri
 
M

Matt Garrish

Uri said:
b> Paul Lalli wrote:

b> You are a spectacular asshole.


b> Then why do *you* spell it PERL here?

b> http://cgi2.cs.rpi.edu/~lallip/perl/spring06/index.shtml

b> Dumbshit.

me thinks you are the dumber shit. that is either a font style that
doesn't have lower case or a graphic style. notice just next to it there
is 'Perl Quotes'.

Is junior still trying to post here? I can't decide if he's as stupid
as his writing or if he's writing to the best of his abilities. Either
way, he's the most boring and dimwitted kind of troll...

Matt
 
B

beartiger

Uri said:
b> Paul Lalli wrote:

b> You are a spectacular asshole.


b> Then why do *you* spell it PERL here?

b> http://cgi2.cs.rpi.edu/~lallip/perl/spring06/index.shtml

b> Dumbshit.

me thinks you are the dumber shit.

Methinks if you're going to call other people dumbshits, you should
learn the correct spelling of "methinks", dumbshit.
that is either a font style that
doesn't have lower case or a graphic style.

I don't think someone who hasn't found SHIFT on his keyboard is in any
position to comment on fonts or capitalization.
notice just next to it there
is 'Perl Quotes'.

Quick quiz for you, Urine Gnatman. Why would an asshole who goes about
on USENET being an asshole by correcting others' capitalization of
"Perl" spell it with ALL CAPS at the top of his index page (whatever
the excuse)? Because he's a dumbshit, that's why.


J
 
B

beartiger

Matt Garrish wrote:
Is junior still trying to post here?

Are you still posting OT posts here after calling those who do
"morons", moron?

What does your post have to do with the language called Perl, Garrish?
If nothing, what exempts you from posting on topic here?


John
 
U

Uri Guttman

b> I don't think someone who hasn't found SHIFT on his keyboard is in any
b> position to comment on fonts or capitalization.

oooh, i am so hertz by that. please may i have another?

b> Quick quiz for you, Urine Gnatman. Why would an asshole who goes about
b> on USENET being an asshole by correcting others' capitalization of
b> "Perl" spell it with ALL CAPS at the top of his index page (whatever
b> the excuse)? Because he's a dumbshit, that's why.

oh, insulting me with the 'urine' variation. that is so original. please
patent this insult and sue all the others who have babbled it before.

anyhow, this is a perl newsgroup and as you have nothing to say about
perl you should leave now. go or i will tell your mother on you and you
will go to bed without your supper or amiga to play with.

now i await your further childish responses which have nothing to do
with perl. tick. tick. tick.

uri
 
U

Uri Guttman

b> Matt Garrish wrote:

b> Are you still posting OT posts here after calling those who do
b> "morons", moron?

b> What does your post have to do with the language called Perl, Garrish?
b> If nothing, what exempts you from posting on topic here?


because he actually helps people with perl here. you do not. simple
binary test but that is beyond your skill level it seems. now go away
before your hurt yourself with those scissors.

uri
 
B

beartiger

Mumia said:
Beartiger, why am I listening to you troll and abuse people? Oh wait,
I'm not.

And of course you didn't respond, like a dog to Pavlov's bell, to
someone you consider a "troll". Oh wait, you just did--proving you're
a moron who just fell hook, line, and sinker for my "troll".

I'll believe it when I see it.


J
 
B

beartiger

Gee, what happened to Gnatman's misspelling? Hmm, seems to have
mysteriously gone missing. I don't suppose he deleted it because it
was just a little bit embarrassing, eh? Naw. Why would he do that?

Heh heh.
b> I don't think someone who hasn't found SHIFT on his keyboard is in any
b> position to comment on fonts or capitalization.

oooh, i am so hertz by that. please may i have another?


b> Quick quiz for you, Urine Gnatman. Why would an asshole who goes about
b> on USENET being an asshole by correcting others' capitalization of
b> "Perl" spell it with ALL CAPS at the top of his index page (whatever
b> the excuse)? Because he's a dumbshit, that's why.

oh, insulting me with the 'urine' variation.

On an asshole scale of 1 to 8, urinate.
that is so original. please
patent this insult and sue all the others who have babbled it before.

anyhow, this is a perl newsgroup and as you have nothing to say about
perl you should leave now.

Make me. By the way, you can talk about others posting off topic,
because this post of your is sooooo relevant to Perl. Why don't you go
tell someone to use strict or warnings for the billionth time? Why
don't you tell someone to consult perldoc? That's a really fabulous
"contribution" to the Perl community.
go or i will tell your mother on you and you
will go to bed without your supper or amiga to play with.

now i await your further childish responses which have nothing to do
with perl. tick. tick. tick.

Right, and you'll go right on responding to someone you consider
"childish", while criticizing him for posting off topic while you
continue to do it yourself. Kook.

What does your response have to do with Perl? Or didn't you think
about that before you decided to chide me for posting off topic?

If it has nothing to do with Perl, what exempts you from posting on
topic?



J
 
B

beartiger

Uri said:
b> Matt Garrish wrote:


b> Are you still posting OT posts here after calling those who do
b> "morons", moron?

b> What does your post have to do with the language called Perl, Garrish?
b> If nothing, what exempts you from posting on topic here?


because he actually helps people with perl here.

How does his or your off topic posts help people with the language you
don't even know how to spell properly?

Go ahead. Tell us, and burn up yet more bandwidth on this ng with your
off-topic posts.


J
 
U

Uri Guttman

b> If it has nothing to do with Perl, what exempts you from posting on
b> topic?


by virtue of my trying to get you to leave. but you won't. have fun. we
have outlasted much worse trolls than you. you might as well leave now
because you will become bored trolling here.

on topic includes managing and isolating trolls. you are not wanted and
you aren't funny or anything but a troll. live with it. leave.

uri
 
B

beartiger

Uri said:
b> If it has nothing to do with Perl, what exempts you from posting on
b> topic?


by virtue of my trying to get you to leave. but you won't. have fun.

A cunning strategy: to get someone you consider a "troll" to leave by
.... replying over and over and over to him! You is reeil smaht.
we
have outlasted much worse trolls than you. you might as well leave now
because you will become bored trolling here.
BURRRRRRRP.

on topic includes managing and isolating trolls. you are not wanted and
you aren't funny or anything but a troll. live with it. leave.

Did you know your first name may be changed to the word urine by the
addition of a mere two letters?


J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top