From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17131 invoked from network); 23 Mar 2002 19:54:45 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 23 Mar 2002 19:54:45 -0000 Received: (qmail 3863 invoked by alias); 23 Mar 2002 19:54:30 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 4768 Received: (qmail 3851 invoked from network); 23 Mar 2002 19:54:28 -0000 From: "Bart Schaefer" Message-Id: <1020323195417.ZM29005@candle.brasslantern.com> Date: Sat, 23 Mar 2002 19:54:17 +0000 In-Reply-To: <1020323193618.ZM28746@candle.brasslantern.com> Comments: In reply to "Bart Schaefer" "Re: var expansion in glob pattern?" (Mar 23, 7:36pm) References: <20020323185649.GA12320@ritz.math.fu-berlin.de> <1020323193618.ZM28746@candle.brasslantern.com> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Guckes , zsh-users@sunsite.dk Subject: Re: var expansion in glob pattern? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Mar 23, 7:36pm, Bart Schaefer wrote: } } except that passing [the glob expression] as the argument to "ls" } may do the wrong thing when there are no matches at all. Hmm, just noticed that my solution is also off when there are no matches, because "${#${(f)...}}" didn't behave the way I expected on empty string (returns 1 rather than 0). So really: j=0 for i in 1 2 3 4 5 10 15 20 25 30 35 40 35 40 45 50; do print ${(l:3:)i}k : "$[${#${(f)$(print -l x *(N.Lk-${i}Lk+${j}))}}-1]" ((j=i-1)) done print Rest : "$[${#${(f)$(print -l x *(N.Lk+${j}))}}-1]" -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net