From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20709 invoked from network); 12 Sep 2003 18:39:28 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 12 Sep 2003 18:39:28 -0000 Received: (qmail 4894 invoked by alias); 12 Sep 2003 18:39:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19072 Received: (qmail 4885 invoked from network); 12 Sep 2003 18:39:22 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 12 Sep 2003 18:39:22 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [4.64.232.255] by sunsite.dk (MessageWall 1.0.8) with SMTP; 12 Sep 2003 18:39:22 -0000 Received: (from schaefer@localhost) by candle.brasslantern.com (8.11.6/8.11.6) id h8CIdKC14965 for zsh-workers@sunsite.dk; Fri, 12 Sep 2003 11:39:20 -0700 From: Bart Schaefer Message-Id: <1030912183920.ZM14964@candle.brasslantern.com> Date: Fri, 12 Sep 2003 18:39:20 +0000 In-Reply-To: <22662.1063358877@gmcs3.local> Comments: In reply to Oliver Kiddle "Re: Getting rid of temporaries..." (Sep 12, 11:27am) References: <20030910203429.GA354@DervishD> <20030910223845.GA10805@lorien.emufarm.org> <1030911010623.ZM7489@candle.brasslantern.com> <1378.1063261796@gmcs3.local> <20030911093927.GC50@DervishD> <22662.1063358877@gmcs3.local> X-Mailer: Z-Mail (5.0.0 30July97) To: Zsh Subject: Re: Getting rid of temporaries... MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 12, 11:27am, Oliver Kiddle wrote: } } Wasn't as easy as I thought. Thought I could do something like: } } guniq() { eval "[[ -z ${~REPLY:r:r}.<${~REPLY:r:e}->.jpg(N[2]) ]]" } } print -l *.??.jpg(e:guniq:) } } But eval insists on quoting the third word in what it runs so it does } [[ -z 'foo.<28->.jpg(N[2])' ]] } which is no use. It's not eval that quotes that, it's [[ ]]. The argument to -z et al. is never expanded as a glob pattern. If you use [ -z ... ] instead, you'll get better results. Well, except in 4.0.6, where you'll get a core dump, but that seems to be fixed in 4.0.7 and 4.1.1. So without the function, it's print -l *.??.jpg(e@'eval "[ -z ${~REPLY:r:r}.<${~REPLY:r:e}->.jpg(N[2]) ]"'@) where @ is chosen as a character that appears nowhere in the expression.