'scp' returns incorrect exit code (OpenSSH_2.5.2p2)

Markus Friedl markus.friedl at informatik.uni-erlangen.de
Tue Mar 27 09:35:17 EST 2001


this is because scp just calls ssh, and scp does not return
the exit-code from ssh. should it?

On Sun, Mar 25, 2001 at 08:59:02AM +0200, Anonymous wrote:
> 
> 'scp' returns a zero exit code, even if it fails to perform the desired task.
> 	bash-2.03$ scp nonexistent at no.such.domain:some/file .; echo $?
> 	ssh: no.such.domain: Name or service not known
> 	0
> 
> 
> 'ssh' will however return a non zero exit code in a similar situation.
> 	bash-2.03$ ssh nonexistent at no.such.domain date; echo $?
> 	ssh: no.such.domain: Name or service not known
> 	255
> 
> This behaviour was noticed with
> 	bash-2.03$ ssh -V
> 	OpenSSH_2.5.2p2, SSH protocols 1.5/2.0, OpenSSL 0x0090581f
> on a linux x86 box
> 
> 
> Keep up the good work guys.
> (And let Mr. Ylonen alone in his grief for his lost ssh-trademark case).
> 



More information about the openssh-unix-dev mailing list