I am using latest Linux Alpine (3.6) as OS in a docker container (also tested on Ubuntu 16.10 outside of Docker with same result).
I have installed openssh (
apk add openssh).
Here is my command :
scp -i $KEY_PATH -P $PORT -o StrictHostKeyChecking=no $USER@$HOST:$FILENAME .
When scp successfully copies a file, it exists with 0 (expected).
When the file is not found, scp says :
No such file or directory but does not exits. What can I do to get a proper exit with a non 0 code ? Could it be a problem on the server or network ?