Re: Returing exit status in perl

2010-09-27 Thread Whacky™
On Sep 23, 9:42 pm, soorajspadmanab...@gmail.com (Sooraj S) wrote: > p2 > === > use Net::Telnet; > > $t = new Net::Telnet(); > $t->open("machine"); > $t->login("user","paswd"); > $t->cmd("p3 $flag"); > $t->close(); Since you are using the Net::Telnet Module.. it would have been better if you used

Re: Returing exit status in perl

2010-09-24 Thread C.DeRykus
} > elsif ($? == 1) { print "failure"; } > else { print "Undefined exit status"; } > > > > p2 > === > use Net::Telnet; > > $t = new Net::Telnet(); > $t->open("machine"); > $t->login("user","paswd&

Re: Returing exit status in perl

2010-09-24 Thread Shlomi Fish
; > In p3 u can see that my $file = "/hom/user/file"; > I've given the location wrongly as a part of error handiling. So p3 > prints "Failed to create backup with exit status 256" and exits. > > In p2 i've checked "$?" value after $t->cmd

Re: Returing exit status in perl

2010-09-24 Thread Sooraj S
; I've given the location wrongly as a part of error handiling. So p3 prints "Failed to create backup with exit status 256" and exits. In p2 i've checked "$?" value after $t->cmd("p3 $flag") but it is zero. Pls help me. -- To unsubscribe, e-mail: beg

Re: Returing exit status in perl

2010-09-24 Thread Shlomi Fish
(p2 $opt); > if ($? == 0) { print "success"; } > elsif ($? == 1) { print "failure"; } > else { print "Undefined exit status"; } > > Please see: http://perl-begin.org/tutorials/bad-elements/ for how to write these codes properly. > &

Returing exit status in perl

2010-09-24 Thread Sooraj S
value. I need the value 256 in p2. Could any one help me to sove this.. p1 === system(p2 $opt); if ($? == 0) { print "success"; } elsif ($? == 1) { print "failure"; } else { print "Undefined exit status"; } p2 === use Net::Telnet; $t

AW: exit status

2009-06-30 Thread Thomas Bätzler
Irfan Sayed asked: > call but in this case how shud i inform to windows batch script that the > perl script execution / exit status is non zero and stop execution > further Use exit() with a non-zero argument. Look at "HELP IF" for your windows batch programming question.

Re: exit status

2009-06-30 Thread Raymond Wan
Hi Irfan, Irfan Sayed wrote: I have one windows batch script in which i am calling one perl script. now what i want to do is if the exit status of that perl script is non zero then batch script should not continue executing further and if the exit status is zero then only it shud further

exit status

2009-06-30 Thread Irfan Sayed
Hi All, I have one windows batch script in which i am calling one perl script. now what i want to do is if the exit status of that perl script is non zero then batch script should not continue executing further and if the exit status is zero then only it shud further execute. normally we use

Re: Exit status of system commands

2009-01-01 Thread Chas. Owens
On Thu, Jan 1, 2009 at 07:38, Duck wrote: > I am writing a script to ping several systems and then to run nslookup > on those that fail the ping test. How do I capture the exit status of > the system commands. I tried something like: > > $status = system("nslookup xxx.xx

Re: Exit status of system commands

2009-01-01 Thread Mr. Shawn H. Corey
On Thu, 2009-01-01 at 04:38 -0800, Duck wrote: > I am writing a script to ping several systems and then to run nslookup > on those that fail the ping test. How do I capture the exit status of > the system commands. I tried something like: > > $status = system("nslo

Exit status of system commands

2009-01-01 Thread Duck
I am writing a script to ping several systems and then to run nslookup on those that fail the ping test. How do I capture the exit status of the system commands. I tried something like: $status = system("nslookup xxx.xxx.xxx.xxx"); print "$status"; but this seems to

exit status

2006-08-14 Thread Sayed, Irfan \(Irfan\)
Hi All, I am executing a specific command thru perl script. if the output of the command is NULL (not error , not any output) then that NULL output / status i want to catch. Can anybody please help. Regards Irfan.

RE: Script Exit Status

2003-12-02 Thread Tim Johnson
Perldoc -f exit -Original Message- From: Paul Kraus [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 02, 2003 9:32 AM To: [EMAIL PROTECTED] Subject: Script Exit Status Is there a way to have a perl script exit with a status code? -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

RE: Script Exit Status

2003-12-02 Thread Kipp, James
> > > Is there a way to have a perl script exit with a status code? > > For instance I have ascript that calls another script via > system("somescript"); > > I want to then be able to get the exit status of that script. > > Paul Have you seen the per

Script Exit Status

2003-12-02 Thread Paul Kraus
Is there a way to have a perl script exit with a status code? For instance I have ascript that calls another script via system("somescript"); I want to then be able to get the exit status of that script. Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman