Search code examples
linuxscp

Why does scp has an exit status of 0 after reporting an error?


Whether on Linux or Cygwin, I get the following (note the invalid space in the username):

>scp file.txt "invalid user@host.com:file.txt"
invalid user: invalid user name
>echo $?
0

Why is the exit status 0?

Note: I'm aware of the known bug related to scp failing silently - but in the above case an error is printed to stderr.


Solution

  • Appears to be a bug. I reported it.