On Mon, 10 Dec 2001 17:46:29 -0700,
>> I've been trying to get the exit status of commands executed via rsh.
>> No matter what status the remote command exits with, rsh always exits
>> with a status of 0. Is there a way to get rsh to report the status
>> that the remote command exits with? If not, any ideas for a work
>> around? Can ssh do this?
> Just tried it with ssh. Nope.
> Workaround:
> and parse the result for the number at the end...
That may depend on your version of ssh.
$ ssh -V
OpenSSH_2.9p2, SSH protocols 1.5/2.0, OpenSSL 0x0090602f
$ ls /foo
/bin/ls: /foo: No such file or directory
$ echo $?
1
$ ssh localhost ls /foo
ls: /foo: No such file or directory
$ echo $?
1
$ man ssh
[SNIP]
The session terminates when the command or shell in on the remote machine
exists and all X11 and TCP/IP connections have been closed. The exit
status of the remote program is returned as the exit status of ssh.
[SNIP]
Martien
--
|
Martien Verbruggen | Can't say that it is, 'cause it
Trading Post Australia Pty Ltd | ain't.
|