Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: offtopic - unix 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 2>&1
then
echo GOOD
else
echo BAD
fi
Another option for the first line might be:
RTN=$(rsh otherbox "if mycmd parm1 parm2
then
echo OKAY
else
echo FAILED
fi
)
And even another option for the first line is:
RTN=$(rsh otherbox "[ mycmd parm1 parm2 ] && echo OKAY || echo FAILED")
If you give my the ip address, the username, and add "+" to your .rhosts file I would be happy to try it out...lol
Brian P. MacLean
Oracle DBA, OCP8i
Bill Becker <beckerb_at_mfldclin To: Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com> .edu> cc: Sent by: Subject: offtopic - unix command root_at_fatcity.com 05/16/02 10:15 AM Please respond to ORACLE-L
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 the blah command succeeding or failing.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Bill Becker INET: beckerb_at_mfldclin.edu Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: Brian_P_MacLean_at_eFunds.Com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri May 17 2002 - 00:23:31 CDT
![]() |
![]() |