FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 04-16-2008, 02:06 PM
Mick
 
Default scp escape characters

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.
--
Regards,
Mick
--
gentoo-user@lists.gentoo.org mailing list
 
Old 04-16-2008, 02:10 PM
Michal 'vorner' Vaner
 
Default 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
 
Old 04-16-2008, 02:12 PM
 
Default 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:

scp remote_host:~/File with blanks

And, of course, it copies the file just fine :-)

HTH...

Dirk
--
Dirk Heinrichs | Tel: +49 (0)162 234 3408
Configuration Manager | Fax: +49 (0)211 47068 111
Capgemini Deutschland | Mail: dirk.heinrichs@capgemini.com
Wanheimerstraße 68 | Web: http://www.capgemini.com
D-40468 Düsseldorf | ICQ#: 110037733
GPG Public Key C2E467BB | Keyserver: www.keyserver.net
 
Old 04-16-2008, 02:29 PM
Mick
 
Default scp escape characters

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
 
Old 04-16-2008, 02:31 PM
Etaoin Shrdlu
 
Default 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
 
Old 04-16-2008, 02:46 PM
Etaoin Shrdlu
 
Default 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
 
Old 04-16-2008, 02:50 PM
Mike Edenfield
 
Default 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 ?


It's escaping the first slash and the space:

' ' -> ' ' -> ' '

--K

--
gentoo-user@lists.gentoo.org mailing list
 

Thread Tools




All times are GMT. The time now is 11:59 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org