From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11885 invoked from network); 20 Aug 2004 09:44:26 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 20 Aug 2004 09:44:26 -0000 Received: (qmail 1842 invoked from network); 20 Aug 2004 09:44:20 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 20 Aug 2004 09:44:20 -0000 Received: (qmail 654 invoked by alias); 20 Aug 2004 09:15:36 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7891 Received: (qmail 568 invoked from network); 20 Aug 2004 09:15:35 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by 130.225.247.90 with SMTP; 20 Aug 2004 09:15:35 -0000 Received: (qmail 82097 invoked from network); 20 Aug 2004 09:13:37 -0000 Received: from pat.uio.no (129.240.130.16) by a.mx.sunsite.dk with SMTP; 20 Aug 2004 09:13:35 -0000 Received: from mail-mx6.uio.no ([129.240.10.47]) by pat.uio.no with esmtp (Exim 4.34) id 1By5Bl-0000VE-57 for zsh-users@sunsite.dk; Fri, 20 Aug 2004 10:55:57 +0200 Received: from 143.80-203-48.nextgentel.com ([80.203.48.143] helo=s.hn.org) by smtp.uio.no with asmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1By5Bg-0008GV-GC for zsh-users@sunsite.dk; Fri, 20 Aug 2004 10:55:52 +0200 Received: (qmail 1596 invoked by uid 1000); 20 Aug 2004 08:55:46 -0000 Date: Fri, 20 Aug 2004 10:55:46 +0200 From: Haakon Riiser To: zsh-users@sunsite.dk Subject: Re: In the tla completion function: "${(@P)var_cmd-*:FILE:_files}" Message-ID: <20040820085546.GA1174@s> Mail-Followup-To: zsh-users@sunsite.dk References: <20040816213204.GA6795@s> <20040817005205.GB2869@iup.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040817005205.GB2869@iup.edu> User-Agent: Mutt/1.5.6i X-MailScanner-Information: This message has been scanned for viruses/spam. Contact postmaster@uio.no if you have questions about this scanning X-UiO-MailScanner: No virus found X-UiO-Spam-info: not spam, SpamAssassin (score=0, required 12) 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=BAYES_01,RCVD_IN_SORBS autolearn=no version=2.63 X-Spam-Hits: -0.0 [Jason McCarty] > > if $var_cmd is not defined, I'd expect the expansion to give the > > string after the '-': > > $var_cmd is always defined to something of the form "cmd_*" on line 658. > I believe the P flag is evaluated before the - expansion, although I > don't see an explicit mention of it in the manpage. The variable named > by $var_cmd may or may not be defined, which is where the - expansion > comes into play. > > I'm afraid I came up with many of my fancy substitutions by trial and > error ;-) Hmm, strange that my shell gives 'bad substitution' when var_cmd is not defined. % unset var_cmd % echo "${(@P)var_cmd-*:FILE:_files}" zsh: bad substitution In your case, the result is % unset var_cmd % echo "${(@P)var_cmd-*:FILE:_files}" *:FILE:_files Right? -- Haakon