On Linux or Cygwin, I get the following (note the invalid location in the username):
>scp file.txt "invalid user@host.com:file.txt"
invalid user: invalid user name
>echo $?
0
Why is exit status 0?
Note. I know a well-known error related to scp failure, but in the above case the error is printed in stderr.
source
share