The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

SCP not escaping spaces [SOLVED]

TrentusTrentus Registered User regular
edited March 2008 in Help / Advice Forum
Hey all,

So I've been trying to copy a file on a remote server to my local machine using SCP, but I can't get the thing to escape spaces.

I've tried the following:
scp trentus@server.com:"/home/t/trentus/classes/comp org/assignment 1/file.txt" ~/Desktop/file.txt

and I get

scp: /home/t/trentus/class/comp: No such file or directory
scp: org/assignment: No such file or directory
scp: 1/file.txt: No such file or directory


and
scp trentus@server.com:/home/t/trentus/classes/comp\ org/assignment\ 1/file.txt ~/Desktop/file.txt
which gives me exactly the same response as the other. Any thoughts? There must be something I'm not doing right.

Trentus on

Posts

  • GanluanGanluan Registered User regular
    edited March 2008
    Have you tried using an underscore for the space? Some programs I've used will interpret a space in a remote file system in an underscore if they don't handle spaces normally. I haven't used SCP so I'm not familiar with it.

    You could even try using %20 instead of spaces, but I doubt you're using a web server :P

    Ganluan on
  • BEAST!BEAST! Adventurer Adventure!!!!!Registered User regular
    edited March 2008
    i think double slashes should work and i think you need double quotes around the path, ie

    scp trentus@server.com:"/home/t/trentus/classes/comp\\ org/assignment\\ 1/file.txt" ~/Desktop/file.txt

    BEAST! on
    dfzn9elrnajf.png
  • TrentusTrentus Registered User regular
    edited March 2008
    I just get a no such file/directory. Thanks for the thought though.

    Fugu, a GUI for SFTP has no problem copying the file using SCP. I'd love to be able to do it via the command line though.

    Edit:
    BEAST! wrote: »
    i think double slashes should work and i think you need double quotes around the path, ie

    scp trentus@server.com:"/home/t/trentus/classes/comp\\ org/assignment\\ 1/file.txt" ~/Desktop/file.txt

    That worked perfectly. Thank you very much. The only question is, why? I might have to ask one of lab assistants or something.

    Trentus on
  • BEAST!BEAST! Adventurer Adventure!!!!!Registered User regular
    edited March 2008
    ok..seems i was incorrect on the double slashes

    single slash, surround it with double quotes, and that SHOULD work...at least works for me here

    BEAST! on
    dfzn9elrnajf.png
Sign In or Register to comment.