From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27374 invoked from network); 23 Jul 2004 17:50:13 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 23 Jul 2004 17:50:13 -0000 Received: (qmail 18493 invoked from network); 23 Jul 2004 17:50:08 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 23 Jul 2004 17:50:08 -0000 Received: (qmail 10274 invoked by alias); 23 Jul 2004 17:49:24 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7742 Received: (qmail 10264 invoked from network); 23 Jul 2004 17:49:24 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 23 Jul 2004 17:49:24 -0000 Received: (qmail 15199 invoked from network); 23 Jul 2004 17:47:26 -0000 Received: from unknown (HELO moonbase.zanshin.com) (167.160.213.139) by a.mx.sunsite.dk with SMTP; 23 Jul 2004 17:47:23 -0000 Received: from toltec.zanshin.com (toltec.zanshin.com [64.84.47.166]) by moonbase.zanshin.com (8.12.11/8.12.11) with ESMTP id i6NHlKWL031449 for ; Fri, 23 Jul 2004 10:47:21 -0700 Date: Fri, 23 Jul 2004 10:47:20 -0700 (PDT) From: Bart Schaefer Reply-To: zsh-users@sunsite.dk To: zsh-users@sunsite.dk Subject: Re: scp and globbing in zsh In-Reply-To: <23e98abb04072309486560f63e@mail.gmail.com> Message-ID: References: <23e98abb04072309486560f63e@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Spam-Checker-Version: SpamAssassin 2.63 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, hits=0.0 required=6.0 tests=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Fri, 23 Jul 2004, matt m wrote: > $ scp someserver:~/tmp/*.txt . > $ scp *.txt someserver:~/tmp/ > > I could just put single quotes around the server path to get it to work > with globbing but after many years of bash I am having trouble getting > into the habbit of using single quotes with scp I suspect that you just want "setopt no_nomatch" so that the glob pattern is left unexpanded when it doesn't find any matching files. (You may have to "unsetopt null_glob csh_null_glob" as well.) That's the only way I can think of that this would do as you seem to expect in bash but not in zsh. If for some reason you want "nomatch" behavior for other commands but not for scp, you have to play some games of this sort: glob_scp() { emulate -L zsh array args local a for a do if [[ $a = *:* ]] then args=( $args $a ) # args+=($a) if you have zsh 4.2+ else args=( $args $~a ) # args+=($~a) fi done scp $args } alias scp='noglob glob_scp'