develooper Front page | perl.beginners | Postings from February 2002

RE: still not catching error

Thread Previous | Thread Next
John Edwards
February 1, 2002 08:58
RE: still not catching error
Message ID:

$result = `rsh $plant /u1/bin/forkit '/u1/bin/'`;

print $result;

You are storing the output of the rsh... command into the variable. You can
now run a regex on that to check for success/failure.

I don't know what the output should be but as an example...

$result = `rsh $plant /u1/bin/forkit '/u1/bin/'`;

if ($result =~ /worked/i) {
	print "Yep, that worked\n";
} else {
	print "Ooops. Something went wrong: $result";



-----Original Message-----
From: Alex Harris []
Sent: 01 February 2002 16:52
Subject: still not catching error

I took out the exec and placed system.  But even though doesn't 
exist on the remote system, still getting no error.  Help!

if (system("rsh $plant /u1/bin/forkit '/u1/bin/'") > 0)
        excep(" $!\n");

Send and receive Hotmail on your mobile device:

To unsubscribe, e-mail:
For additional commands, e-mail:

This E-mail is confidential.  It should not be read, copied, disclosed or
used by any person other than the intended recipient.  Unauthorised use,
disclosure or copying by whatever medium is strictly prohibited and may be
unlawful.  If you have received this E-mail in error please contact the
sender immediately and delete the E-mail from your system.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About