Bug 1205 - scp back-slash escaping of spaces ignored after username@hostname: tag
Summary: scp back-slash escaping of spaces ignored after username@hostname: tag
Status: CLOSED WONTFIX
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: 4.3p2
Hardware: ix86 Linux
: P3 normal
Assignee: Assigned to nobody
URL:
Keywords: low-hanging-fruit
Depends on:
Blocks:
 
Reported: 2006-07-03 23:54 AEST by Davide Cescato
Modified: 2006-10-07 11:45 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Cescato 2006-07-03 23:54:51 AEST
Back-slash escaping of spaces works when accessing local files:

[genie@homeland ~]$ echo "hello" > spa\ ce
[genie@homeland ~]$ ls -l spa\ ce
-rw-rw-r-- 1 genie genie 6 Jul  3 14:58 spa ce
[genie@homeland ~]$  scp /home/genie/spa\ ce bugzilla@armageddon.ethz.ch:/home/bugzilla
spa ce                                                   100%    6     0.0KB/s   00:00


The file is actually on the remote machine:

[bugzilla@armageddon ~]$ ls -l spa\ ce
-rw-rw-r-- 1 bugzilla bugzilla 6 Jul  3 14:58 spa ce


If I now try to copy the file from the remote machine, I get the following error:

[genie@homeland ~]$ rm spa\ ce
[genie@homeland ~]$ scp bugzilla@armageddon.ethz.ch:/home/bugzilla/spa\ ce . 
scp: /home/bugzilla/spa: No such file or directory
scp: ce: No such file or directory


Hence, back-slash escaping of spaces after a "username@hostname:" tag seems to be ignored.
Comment 1 Tomas Mraz 2006-07-04 17:23:14 AEST
I'd say that this is a feature rather than a bug. The path is again shell expanded on the remote machine.
This will work:
scp "<host>:<path>/spa\\ ce" .
Comment 2 Damien Miller 2006-07-12 10:49:51 AEST
Sorry - we can't fix this: it is a 20+ year old limitation of rcp that scp has inherited and changing the behaviour of scp would break many people's working scripts. 
Comment 3 Darren Tucker 2006-10-07 11:45:30 AEST
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.