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")
These will work but depend on shell-specific syntax. Using a #! file on the remote end is a bit safer and allows for comments in the code.
-- Steven Lembark 2930 W. Palmer Workhorse Computing Chicago, IL 60647 +1 800 762 1582 -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Steven Lembark INET: lembark_at_wrkhors.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 - 01:13:24 CDT
![]() |
![]() |