zsh-users
 help / color / mirror / code / Atom feed
* colons in names to scp
@ 2006-02-09 20:58 Deliverable Mail
  2006-02-09 21:58 ` Chris Johnson
  0 siblings, 1 reply; 2+ messages in thread
From: Deliverable Mail @ 2006-02-09 20:58 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 363 bytes --]

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..

Cheers,
Alexy.

[-- Attachment #2: Type: text/html, Size: 483 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: colons in names to scp
  2006-02-09 20:58 colons in names to scp Deliverable Mail
@ 2006-02-09 21:58 ` Chris Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Johnson @ 2006-02-09 21:58 UTC (permalink / raw)
  To: zsh-users; +Cc: Deliverable Mail

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@cs.utk.edu
http://www.cs.utk.edu/~cjohnson


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-02-09 21:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-09 20:58 colons in names to scp Deliverable Mail
2006-02-09 21:58 ` Chris Johnson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).