Re: rsh and return code

From: Green, Simon (SGreen@KRAFTEUROPE.COM)
Date: Wed Nov 06 2002 - 07:00:38 EST


I don't think that you can do this. $? isn't available through rsh/dsh.

You could write a simple script to run your command then echo the return
code.

Simon Green
Philip Morris ITSC Europe

AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
AIX FAQ at http://www.faqs.org/faqs/aix-faq/

N.B. Unsolicited email from vendors will seldom be appreciated.

> -----Original Message-----
> From: fmu@OERAG.DE [mailto:fmu@OERAG.DE]
> Sent: 06 November 2002 11:33
> To: aix-l@Princeton.EDU
> Subject: rsh and return code
>
>
> Hi *,
> I want to start a command on a remote node (whith rsh
> or dsh) and
> want like to know afterwards the return code
>
> For example:
>
> rsh <nodename> "date ; echo $?"
>
> But I don't get the right return code. I test it with a wrong command:
>
> # dsh -w styx "datkdajfk ; echo $?"
> styx: 0
> styx: ksh: datkdajfk: not found
> (root:hermes)[/]
>
> # rsh styx "datkdajfk ; echo $?"
> 0
> ksh: datkdajfk: not found.
> (root:hermes)[/]
> #



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:18 EDT