I was trying to scp a file which had spaces in its name; e.g.
This is the name of it.txt
But scp would fail each time saying that the name is ambiguous (or
something similar). I also tried enclosing the name in 'single', or
"double" quotes, but it wouldn't have any.
What's the right way of doing this?
Both boxen running gentoo and I was using bash shell.
--
Regards,
Mick
--
gentoo-user@lists.gentoo.org mailing list
04-16-2008, 02:10 PM
Michal 'vorner' Vaner
scp escape characters
Hello
On Wed, Apr 16, 2008 at 03:06:05PM +0100, Mick wrote:
> Hi All,
>
> I was trying to scp a file which had spaces in its name; e.g.
>
> This is the name of it.txt
There is a problem ‒ it unescapes at both ends, so you need to
double-escape it, like
'Filename with spaces'
or
Filename with spaces.
Or, something like that (if I see it right).
--
Support your right to arm bears!!
Michal 'vorner' Vaner
04-16-2008, 02:12 PM
scp escape characters
Am Mittwoch, den 16.04.2008, 15:06 +0100 schrieb ext Mick:
> I was trying to scp a file which had spaces in its name; e.g.
>
> This is the name of it.txt
>
> But scp would fail each time saying that the name is ambiguous (or
> something similar). I also tried enclosing the name in 'single', or
> "double" quotes, but it wouldn't have any.
>
> What's the right way of doing this?
>
> Both boxen running gentoo and I was using bash shell.
I tried it in my zsh, with TAB-completion (means: I typed "scp
remote_host:~/Fil<tab>"), and it gives this:
On 16/04/2008, dirk.heinrichs.ext@nsn.com <dirk.heinrichs.ext@nsn.com> wrote:
> Am Mittwoch, den 16.04.2008, 15:06 +0100 schrieb ext Mick:
>
>
> > I was trying to scp a file which had spaces in its name; e.g.
> >
> > This is the name of it.txt
> I tried it in my zsh, with TAB-completion (means: I typed "scp
> remote_host:~/Fil<tab>"), and it gives this:
>
> scp remote_host:~/File with blanks
>
> And, of course, it copies the file just fine :-)
Thanks guys, I'll try it next time. Just one thing: if the spaces
need to be escaped at both ends, shouldn't it have just 2 , why are
you showing it with 3 ?
--
Regards,
Mick
--
gentoo-user@lists.gentoo.org mailing list
04-16-2008, 02:31 PM
Etaoin Shrdlu
scp escape characters
On Wednesday 16 April 2008, 16:06, Mick wrote:
> Hi All,
>
> I was trying to scp a file which had spaces in its name; e.g.
>
> This is the name of it.txt
>
> But scp would fail each time saying that the name is ambiguous (or
> something similar). I also tried enclosing the name in 'single', or
> "double" quotes, but it wouldn't have any.
>
> What's the right way of doing this?
>
> Both boxen running gentoo and I was using bash shell.
Either
$ scp 'This is the name of it.txt' user@remote:/dst/dir
or
$ scp user@remote:'/src/dir/This is the name of it.txt' /dst/dir
depending on who's local and who's remote, should work.
If neither does, post the actual command you were using.
PS: Of course, if only that file begins with that characters, you can
cheat and do
$ scp user@remote:/src/dir/This* /dst/dir
--
gentoo-user@lists.gentoo.org mailing list
04-16-2008, 02:46 PM
Etaoin Shrdlu
scp escape characters
On Wednesday 16 April 2008, 16:31, Etaoin Shrdlu wrote:
> $ scp user@remote:'/src/dir/This is the name of it.txt' /dst/dir
Wrong (sorry). You need to both quote and escape spaces.
--
gentoo-user@lists.gentoo.org mailing list
04-16-2008, 02:50 PM
Mike Edenfield
scp escape characters
Mick wrote:
On 16/04/2008, dirk.heinrichs.ext@nsn.com <dirk.heinrichs.ext@nsn.com> wrote:
Am Mittwoch, den 16.04.2008, 15:06 +0100 schrieb ext Mick:
> I was trying to scp a file which had spaces in its name; e.g.
>
> This is the name of it.txt
I tried it in my zsh, with TAB-completion (means: I typed "scp
remote_host:~/Fil<tab>"), and it gives this:
scp remote_host:~/File with blanks
And, of course, it copies the file just fine :-)
Thanks guys, I'll try it next time. Just one thing: if the spaces
need to be escaped at both ends, shouldn't it have just 2 , why are
you showing it with 3 ?