>>Hai Everyone,
>> I am writing a shell script which would run commands on the remote
>>shell (rsh -l login_name command). I need to write further code based
>>on the exit status of the command that is run on the remote shell. My
>>'rsh' command always returns '0' as the exit status, which I don't
>>need. Can anyone suggest me as to how I can find the exit status of a
>>command run on the remote shell?
>one way you can do it is to output the exit status and capture
>that to a variable;
>rsh -K hostname sh -c 'false; echo $?' |read status
>echo return status is $status
this workz a lot better of course (infinitely even);
status=`rsh -K hostname sh -c 'false; echo $?' `
echo return status is $status
the original version I posted (and didn't test, and
didn't even _think_ <g>) won't work because '|read status'
is executed in a sub-shell.
${L}
Quote:>bye,
>${L}
>>Thanks in advance.
>>Sridhar G