I have a bash script that uses scp to copy a file from my machine to another. The script keeps on exiting after I enter the SSH password with the error:
<filename>: No such file or directory Yet, in the script, I check the file, and it is just fine. I did set -o verbose at the beginning and here's what I get at the end of the script:
scp /Volumes/FX4\ HDD/Users/matthewdavies/Downloads/NCIS.S11E01.HDTV.x264-LOL.mp4 [email protected]:"/media/3TB/TV\ Shows/NCIS" [email protected]'s password: /Volumes/FX4\ HDD/Users/matthewdavies/Downloads/NCIS.S11E01.HDTV.x264-LOL.mp4: No such file or directory So, I tried executing the scp command as outputted and it was fine; it copied. What's going wrong???
scp /Volumes/FX4\ HDD/Users/matthewdavies/Downloads/NCIS.S11E01.HDTV.x264-LOL.mp4 [email protected]:"/media/3TB/TV Shows/NCIS"I think it had to be scp /Volumes/FX4\ HDD/Users/matthewdavies/Downloads/NCIS.S11E01.HDTV.x264-LOL.mp4 "[email protected]:/media/3TB/TV Shows/NCIS"because the last part(destination) is counted as a whole argument.