How do I check the exit status of a remote command?
I am working on a bash script that will execute commands on remote computers using rsh. rsh itself returns an exit code, which I can access by echoing $?. But what I want is the exit code of the command that I remotely executed. Is there a way to get at this?
TIA Thom |
I don't use Rsh (are you sure you should?) but how about just echoing "$?" as in 'RETVAL=$(ssh user@host '/bin/false >/dev/null; echo $?'); echo $RETVAL'?
|
All times are GMT -5. The time now is 12:32 AM. |