From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12106 invoked from network); 9 Feb 2006 21:58:50 -0000 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, FORGED_RCVD_HELO autolearn=ham version=3.1.0 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Feb 2006 21:58:50 -0000 Received: (qmail 54600 invoked from network); 9 Feb 2006 21:58:43 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Feb 2006 21:58:43 -0000 Received: (qmail 25439 invoked by alias); 9 Feb 2006 21:58:35 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9898 Received: (qmail 25427 invoked from network); 9 Feb 2006 21:58:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Feb 2006 21:58:33 -0000 Received: (qmail 53466 invoked from network); 9 Feb 2006 21:58:33 -0000 Received: from ka.cs.utk.edu (160.36.56.221) by a.mx.sunsite.dk with SMTP; 9 Feb 2006 21:58:31 -0000 Received: from localhost (ka [127.0.0.1]) by ka.cs.utk.edu (Postfix) with ESMTP id 804562359C; Thu, 9 Feb 2006 16:58:29 -0500 (EST) Received: from ka.cs.utk.edu ([127.0.0.1]) by localhost (ka [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17187-03; Thu, 9 Feb 2006 16:58:28 -0500 (EST) Received: from cetus5.cs.utk.edu (cetus5.cs.utk.edu [160.36.56.87]) by ka.cs.utk.edu (Postfix) with ESMTP id 0C6E523548; Thu, 9 Feb 2006 16:58:28 -0500 (EST) Received: by cetus5.cs.utk.edu (Postfix, from userid 10605) id C8FE8BE05; Thu, 9 Feb 2006 16:58:27 -0500 (EST) Date: Thu, 9 Feb 2006 16:58:27 -0500 From: Chris Johnson To: zsh-users@sunsite.dk Cc: Deliverable Mail Subject: Re: colons in names to scp Message-ID: <20060209215823.GA26650@cetus5.cs.utk.edu> References: <7c737f300602091258o49d1902cke43c6d7219db125e@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c737f300602091258o49d1902cke43c6d7219db125e@mail.gmail.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: by amavisd-new with ClamAV and SpamAssasin at cs.utk.edu 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