zsh-users
 help / color / mirror / code / Atom feed
From: Chris Johnson <cjohnson@cs.utk.edu>
To: zsh-users@sunsite.dk
Cc: Deliverable Mail <deliverable@gmail.com>
Subject: Re: colons in names to scp
Date: Thu, 9 Feb 2006 16:58:27 -0500	[thread overview]
Message-ID: <20060209215823.GA26650@cetus5.cs.utk.edu> (raw)
In-Reply-To: <7c737f300602091258o49d1902cke43c6d7219db125e@mail.gmail.com>

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


      reply	other threads:[~2006-02-09 21:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-09 20:58 Deliverable Mail
2006-02-09 21:58 ` Chris Johnson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060209215823.GA26650@cetus5.cs.utk.edu \
    --to=cjohnson@cs.utk.edu \
    --cc=deliverable@gmail.com \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).