I have a bash script which generates an SCP command to execute. The relevant parts of the code look like this:
echo $COPY_CMD
$COPY_CMD
My output looks like this:
rascher@localhost:~/Desktop/video_final$ ./xfervids.sh scp "/media/My Book/PhotosVideos/Videos/18May2008Download/SD_VIDEO/PRG001/MOV056.MOD" [email protected]:./video_working/ [email protected]'s password: "/media/My: No such file or directory Book/PhotosVideos/Videos/18May2008Download/SD_VIDEO/PRG001/MOV056.MOD": No such file or directory
However, when I take line 2 of my output: scp "/media/...
, copy it, and paste it into the terminal, it works.
What am I doing wrong? I have tried escaping the space in "My Book" ("My\ Book"
), putting two \
characters rather than one ("My\\ Book"
) but I can't get this to behave consistently. Help?