Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: colons in names to scp
- X-seq: zsh-users 9898
- From: Chris Johnson <cjohnson@xxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: colons in names to scp
- Date: Thu, 9 Feb 2006 16:58:27 -0500
- Cc: Deliverable Mail <deliverable@xxxxxxxxx>
- In-reply-to: <7c737f300602091258o49d1902cke43c6d7219db125e@xxxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <7c737f300602091258o49d1902cke43c6d7219db125e@xxxxxxxxxxxxxx>
Deliverable Mail sent me the following 1.2K:
> I need to copy files via scp from a zsh script. Say, $1 holds a file
> name containing ':'. When I do
>
> scp $1 $host:$dir
>
> I get an error from scp, treating the prefix of $1 before : as a
> source host name. What's the right way to quote it -- '$1' would
> preclude interpolation of $1, which is exactly why $1 is used in the
> first place..
I don't think quotation will fix your problem. $1 is being read as a
single entity by scp. It just thinks looks like something else.
Escaping doesn't seem to work, but Google revealed this:
scp ./$1 $host:$dir
--
Chris Johnson
cjohnson@xxxxxxxxxx
http://www.cs.utk.edu/~cjohnson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author