[torqueusers] no spaces in directory names

Konrad Karczewski xeno at alfa.icis.pcz.pl
Wed Feb 6 03:51:23 MST 2008


Hi,

If I'm not mistaken scp works in the following way: it starts scp
process on the remote machine, passes the appropriate string to it and
then does all the necessary operation to get the data transferred. It's
important to note that the passed string undergoes shell expansion on the
remote side:

scp remote:dir/* .

works 'as expected' bringing all the remote files to local dir. This
actually explains all the cases below:

> On Tue, 2008-02-05 at 18:00 -0800, Garrick Staples wrote:
> > I can get everything working when using local 'cp' (including $usecp-configured
> > network filesystems), but 'scp' really gets the quoting wrong.
> >
> > Seems to me that the first 2 should work, and the rest should fail:
> > $ scp ./foo hpc-admin:/home/rcf-00/garrick/5000\ atoms/
> > scp: ambiguous target
> > $ scp ./foo 'hpc-admin:/home/rcf-00/garrick/5000 atoms/'
> > scp: ambiguous target

In these two cases either "''" or '\ ' gets stripped by local shell - scp
does not get them at all, so the remote process gets broken data (two
strings instead of one)

> >
> > $ scp ./foo hpc-admin:/home/rcf-00/garrick/5000\\ atoms/
> > atoms/: No such file or directory

This is completely off - 'local' scp gets 3 strings, second one ending
with '\'

> > $ scp ./foo hpc-admin:/home/rcf-00/garrick/5000\\\ atoms/
> > foo                                                                          100%  857     0.8KB/s   00:00
> > $ scp ./foo 'hpc-admin:/home/rcf-00/garrick/5000\ atoms/'
> > foo                                                                          100%  857     0.8KB/s   00:00

In those two cases scp gets identical stings - in the first case shell
converts '\\\ ' -> '\ ' and passess to scp, in the second shell strips the
quotation and leaves the string untouched. If you want to pass quotation
to scp you need to 'protect' it from the shell: "\'" .

To cut this short - yes, getting the escapes right is major fun ;)

>
> Yes they should but scp doesn't protect the " " either...
> At least that's how i interpret those results.
> Perhaps a bug report towards scp is in order...

Unfortunately this is no bug - only price of having shell expansion on the
remote side

Hope this helps,

Konrad


> --
> Ake Sandgren, HPC2N, Umea University, S-90187 Umea, Sweden
> Internet: ake at hpc2n.umu.se   Phone: +46 90 7866134 Fax: +46 90 7866126
> Mobile: +46 70 7716134 WWW: http://www.hpc2n.umu.se
>
> _______________________________________________
> torqueusers mailing list
> torqueusers at supercluster.org
> http://www.supercluster.org/mailman/listinfo/torqueusers
>


More information about the torqueusers mailing list