Is there a way to check for the success/failure of the actual remote
command when using rsh?
$a=$(rsh blah);
and parse $a for output for an indication of the blah
command succeeding or failing.
--
Steven Lembark 2930 W. Palmer
Workhorse Computing
I do it all the time with a line like this :
rsh $1 . ${vTARGETPROFILE};mkdir $2;echo \$?
In this case, I am making a directory called $2 at host $1. The unix
command sets the error value so when you can now get that value over on the
calling machine.
You could also do it like this:
rsh
-- Bill Becker [EMAIL PROTECTED]
But what if command blah does not output anything? In this
case, $a is null, as it is when the command fails.
Either:
Look for a success message and change the sense of the test.
Run the remote command in verbose mode.
Wrap the remote command
Haven't used rsh in many many moons (ssh is the correct way these daze),
and I have no way to test this but maybe it will work.
RTN=$(rsh otherbox mycmd parm1 parm2 ; [ ${?} -eq 0 ] echo OKAY || echo
FAILED)
if echo ${RTN} | grep OKAY 1/dev/null 21
then
echo GOOD
else
echo BAD
fi
Another
-- [EMAIL PROTECTED]
Haven't used rsh in many many moons (ssh is the correct way these daze),
and I have no way to test this but maybe it will work.
RTN=$(rsh otherbox mycmd parm1 parm2 ; [ ${?} -eq 0 ] echo OKAY ||
echo FAILED)
if echo ${RTN} | grep OKAY 1/dev/null 21
then
echo