Wednesday, June 22, 2011

SCP and spaces

I was looking for help with linux SCP and spaces in file names. I found a somewhat helpful link here:

Its advice didn't work for me out of the box, however.

What I ended up doing instead that did work was this:

scp -r '"/path/with/a/Space\ In\ It' ./

Which is to say that I single-quoted the whole source argument and single-escaped each space.

I'm dealing with left-parentheses similarly:

scp -r '"/path/with/a/Space\(s)\ In\ It' ./

Looks like there are other characters I need to escape, like single quotes, but I'm not going to worry about those right now. If you have any idea about escaping those in this context, please leave a comment.

No comments: