Hello,
Apologies for the slightly off-topic listing, but I
know there are several unix command gurus out there. (Bambi?)
Oracle 8.1.6 on Solaris 2.7.
I am trying to execute an rsh command against another
unix server; the actual command is
rsh pnas1 chkpntmk oradata ckpt1
if [ $? != 0 ];
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
But what if command blah does not output anything? In this
case, $a is null, as it is when the command fails.
Steven Lembark wrote:
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
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
:
Sent by: Subject: offtopic - unix command
[EMAIL PROTECTED
-- [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