I have a Linux machine and 2 Windows machines. Each Windows machine contains cygwin with an sshd daemon. The Linux machine is the main one I'm using. On the first Windows machine which is XP, I have a file on there that I want to compare with a file on the second Windows machine which is Windows 7.
My thinking is that once I ssh into the XP machine, I should easily be able to use the scp command to grab the file on the Windows 7 machine and then run a diff to compare the 2 files but it first gets tripped up on the spaces within "Program Files" and after using \ to escape those, it gets tripped up on the parenthesis.
$ scp firstname.lastname@example.org:/cygdrive/c/Program\ Files\ (x86)/myfile.xml . -bash: syntax error near unexpected token `('
$ scp email@example.com:/cygdrive/c/Program\ Files\ \(x86\)/myfile.xml . firstname.lastname@example.org's password: bash: -c: line 0: syntax error near unexpected token `(' bash: -c: line 0: `scp -f /cygdrive/c/Program Files (x86)/myfile.xml'
Used a variable
$ scpfile="/cygdrive/c/Program Files (x86)/myfile.xml" $ scp email@example.com:$scpfile . firstname.lastname@example.org's password: scp: /cygdrive/c/Program: No such file or directory cp: cannot stat `Files': No such file or directory cp: cannot stat `(x86)/myfile.xml': No such file or directory
I also tried using a variable with escape slashes but no luck.
If I move myfile.xml to /cygdrive/c/ and then scp it, it will work fine. How do I scp files that are in a directory that contain parenthesis using cygwin's scp?