From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1840 invoked from network); 13 Jun 2004 04:32:55 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.86) by ns1.primenet.com.au with SMTP; 13 Jun 2004 04:32:55 -0000 Received: (qmail 13516 invoked from network); 13 Jun 2004 04:32:35 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Jun 2004 04:32:35 -0000 Received: (qmail 1944 invoked by alias); 13 Jun 2004 04:31:59 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7529 Received: (qmail 1933 invoked from network); 13 Jun 2004 04:31:59 -0000 Received: from thor.dotsrc.org (HELO a.mx.sunsite.dk) (qmailr@130.225.247.86) by sunsite.dk with SMTP; 13 Jun 2004 04:31:55 -0000 Received: (qmail 12151 invoked from network); 13 Jun 2004 04:31:55 -0000 Received: from moonbase.zanshin.com (root@64.84.47.139) by a.mx.sunsite.dk with SMTP; 13 Jun 2004 04:31:54 -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 i5D4Vpn8012573 for ; Sat, 12 Jun 2004 21:31:51 -0700 Date: Sat, 12 Jun 2004 21:31:36 -0700 (PDT) From: Bart Schaefer Sender: schaefer@toltec.zanshin.com Reply-To: zsh-users@sunsite.dk To: zsh-users@sunsite.dk Subject: Re: brace expansion in function In-Reply-To: <20040613015124.GK12538@fruitcom.com> Message-ID: 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 Sun, 13 Jun 2004, Eric Smith wrote: > I would like a shell function that expands the arg > {corrs,dylan,crespo} Do you mean that you have typed mpg {corrs,dylan,crespo} ?? If that's what you did, then the shell will have expanded the braces before invoking the function, so it is the same as if you'd typed mpg corrs dylan crespo (which is actually fewer characters, so I'm not sure why you didn't just type that directly) in which case what you want is something like mpg() { mpg321 *${^@}* } If instead you mean that you typed mpg '{corrs,dylan,crespo}' or some such quoting, then you need mpg() { eval "mpg321 *$1*" } If none of this looks reasonable, you'll have to ask a more detailed question.