From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17601 invoked from network); 11 Sep 2003 01:47:11 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 11 Sep 2003 01:47:11 -0000 Received: (qmail 15943 invoked by alias); 11 Sep 2003 01:47:03 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 19062 Received: (qmail 15918 invoked from network); 11 Sep 2003 01:47:00 -0000 Received: from localhost (HELO sunsite.dk) (127.0.0.1) by localhost with SMTP; 11 Sep 2003 01:47:00 -0000 X-MessageWall-Score: 0 (sunsite.dk) Received: from [66.93.131.57] by sunsite.dk (MessageWall 1.0.8) with SMTP; 11 Sep 2003 1:46:59 -0000 Received: from lorien.emufarm.org (localhost [127.0.0.1]) by lorien.emufarm.org (8.12.7/8.12.7) with ESMTP id h8B1kwkI019731 for ; Wed, 10 Sep 2003 18:46:58 -0700 Received: (from duvall@localhost) by lorien.emufarm.org (8.12.7/8.12.7/Submit) id h8B1kvPo019730 for zsh-workers@sunsite.dk; Wed, 10 Sep 2003 18:46:57 -0700 Date: Wed, 10 Sep 2003 18:46:57 -0700 From: Danek Duvall To: zsh-workers@sunsite.dk Subject: Re: Getting rid of temporaries... Message-ID: <20030911014657.GA19512@lorien.emufarm.org> Mail-Followup-To: Danek Duvall , zsh-workers@sunsite.dk References: <20030910203429.GA354@DervishD> <20030910223845.GA10805@lorien.emufarm.org> <1030911010623.ZM7489@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1030911010623.ZM7489@candle.brasslantern.com> User-Agent: Mutt/1.5.4i On Thu, Sep 11, 2003 at 01:06:23AM +0000, Bart Schaefer wrote: > This suggestion is on the right track, but it's not equivalent to Raul's > original one, because your first assignment may match names that do not > match *.<00-99>.jpg, which won't be modified by the second assignment. Neither does his original; he was selecting all files, too. But yes, you'd probably want to use a more specific globbing pattern. > } will do what you want. The "typeset -U" makes $array discard duplicate > } elements, but that requires the reassignment once the dups are gone > > I'm not sure what you mean by "requires the reassignment once the dups > are gone". You have to strip the suffixes before zsh can tell what the > duplicates are. That's what I meant; I was concentrating on the two-step process and muddled the rest of it. > } The "^" turns on rcexpandparam for the expansion of $array, which means > } that, as an array, each element is modified. > > That's not what rcexpandparam means. Yup. It's gotten stuck in my mind that it's needed for situations other than just concatenation, including anything that needs to operate on every array element. That's obviously wrong. > So we end up with, perhaps: > > typeset -U array > array=( *.<00-99>.jpg(e['REPLY=${REPLY%.??.jpg}']) ) > print -l $array Or array=( *.<00-99>.jpg(e['REPLY=${REPLY%.??.jpg}']) ) print -l ${(u)array} which was more what I was hoping for. There's still no way of expanding a glob inside ${}, short of ${$(echo *)}, is there? Danek