Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: colons in names to scp



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