On Wed, Apr 11, 2007 at 10:02:50PM +0100, Stuart Henderson wrote:
> On 2007/04/11 13:41, Bryan Irvine wrote:
> > <snip>
> > >I agree, spaces in filenames should be avoided. But spaces in
> > >filenames are legal, so programs need to support that; this seems like
> > >a case scp was never tested against because no one uses files with
> > >those names.
> > 
> > I scp'd a file called 'a b' to an openbsd server here, then scp'd it
> > back a couple time in different ways.  It worked only when using the
> > quotes AND escaping, like so:
> > 
> > scp [EMAIL PROTECTED]:"a\ b" .
> 
> you have to escape to *both* your local shell, and the remote shell

You must not escape to your local shell in case the scp process is called
directly by e. g. exec() function in C.

If you have to escape to the remote shell, then it should be mentioned
in man scp. "escape" and "shell" don't occur in man scp and "remote" doesn't
occur in such a context there.

If I wrote it, I would do it in a way that scp performed the escaping
for the remote shell automatically. Having to supply a different filename
depending on where the file is goes against the local-remote transparency
that scp is attempting at.

CL<

Reply via email to