RE: still not catching error

2002-02-02 Thread Bob Showalter

> -Original Message-
> From: Roger C Haslock [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, February 02, 2002 5:43 AM
> To: Bob Showalter; 'Alex Harris'; [EMAIL PROTECTED]
> Subject: Re: still not catching error
> 
> 
> You are testing the exit status of the system call, not the 
> exit status of
> the rsh call which is in $?.
> You need
> 
> $systemstatus=system(...);
> $rshstatus=$?;

>From the docs for system():

   ...The return value is the exit status of the program
   as returned by the "wait" call.  To get the actual
   exit value divide by 256.

So he *is* testing the rsh exit status (at least 0 vs non-zero). 
The problem is that rsh does not return the exit status of the 
command it is running, which is what the OP is trying to check. 
$? will not help him with that.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: still not catching error

2002-02-02 Thread Roger C Haslock

You are testing the exit status of the system call, not the exit status of
the rsh call which is in $?.
You need

$systemstatus=system(...);
$rshstatus=$?;

- Roger -

- Original Message -
From: "Bob Showalter" <[EMAIL PROTECTED]>
To: "'Alex Harris'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, February 01, 2002 9:50 PM
Subject: RE: still not catching error


> > -Original Message-
> > From: Alex Harris [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, February 01, 2002 11:52 AM
> > To: [EMAIL PROTECTED]
> > Subject: still not catching error
> >
> >
> > I took out the exec and placed system.  But even though
> > work.pl doesn't
> > exist on the remote system, still getting no error.  Help!
> >
> > if (system("rsh $plant /u1/bin/forkit '/u1/bin/work.pl'") > 0)
> >   {
> > excep(" $!\n");
> >   }
>
> The exit status of rsh is 0 if it was able to connect to the remote
> system. It doesn't return the exit status of the command being run.
>
> Try this search for some suggestions on handling this issue:
>
> http://groups.google.com/groups?hl=en&q=rsh+exit+status
>
> HTH
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: still not catching error

2002-02-01 Thread Bob Showalter

> -Original Message-
> From: Alex Harris [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 01, 2002 11:52 AM
> To: [EMAIL PROTECTED]
> Subject: still not catching error
> 
> 
> I took out the exec and placed system.  But even though 
> work.pl doesn't 
> exist on the remote system, still getting no error.  Help!
> 
> if (system("rsh $plant /u1/bin/forkit '/u1/bin/work.pl'") > 0)
>   {
> excep(" $!\n");
>   }

The exit status of rsh is 0 if it was able to connect to the remote
system. It doesn't return the exit status of the command being run.

Try this search for some suggestions on handling this issue:

http://groups.google.com/groups?hl=en&q=rsh+exit+status

HTH

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: still not catching error

2002-02-01 Thread John Edwards

Try

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

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/work.pl'`;

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

HTH

John

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


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

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

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--Confidentiality--.
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.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




still not catching error

2002-02-01 Thread Alex Harris

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

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

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]