From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14055 invoked from network); 3 May 2005 16:30:25 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 3 May 2005 16:30:25 -0000 Received: (qmail 91785 invoked from network); 3 May 2005 16:30:19 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 3 May 2005 16:30:19 -0000 Received: (qmail 3701 invoked by alias); 3 May 2005 16:30:11 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 8773 Received: (qmail 3667 invoked from network); 3 May 2005 16:30:10 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 3 May 2005 16:30:10 -0000 Received: (qmail 90627 invoked from network); 3 May 2005 16:30:10 -0000 Received: from vms048pub.verizon.net (206.46.252.48) by a.mx.sunsite.dk with SMTP; 3 May 2005 16:30:06 -0000 Received: from candle.brasslantern.com ([4.11.1.68]) by vms048.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0IFX00GPW9TTUKO0@vms048.mailsrvcs.net> for zsh-users@sunsite.dk; Tue, 03 May 2005 11:29:54 -0500 (CDT) Received: from candle.brasslantern.com (IDENT:schaefer@localhost [127.0.0.1]) by candle.brasslantern.com (8.12.11/8.12.11) with ESMTP id j43GTq7C018495 for ; Tue, 03 May 2005 09:29:52 -0700 Received: (from schaefer@localhost) by candle.brasslantern.com (8.12.11/8.12.11/Submit) id j43GTp3k018494 for zsh-users@sunsite.dk; Tue, 03 May 2005 09:29:52 -0700 Date: Tue, 03 May 2005 16:29:50 +0000 From: Bart Schaefer Subject: Re: Short-circuiting array-subscript glob qualifier? In-reply-to: <44613de005050307262622832e@mail.gmail.com> To: zsh-users@sunsite.dk Message-id: <1050503162951.ZM18493@candle.brasslantern.com> MIME-version: 1.0 X-Mailer: Z-Mail (5.0.0 30July97) Content-type: text/plain; charset=us-ascii References: <44613de005050307262622832e@mail.gmail.com> Comments: In reply to Shawn Halpenny "Short-circuiting array-subscript glob qualifier?" (May 3, 10:26am) X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.6 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.6 On May 3, 10:26am, Shawn Halpenny wrote: } } echo /foo/bar/**/^*,v(.[1,3]) } } I want it to echo the first three matching non-,v plain files. } Unfortunately, zsh still retrieves all filenames that match the glob. Yep, that's right. All qualifiers that work on the file names (rather than on the filesystem attributes) are applied once to the entire list after the glob is done. Well, that's not quite right -- expressions evaluated with (e:...:) are applied to each file as it is found, too, but there's no provision for that to short-circuit the entire glob. } How possible is it to have the glob stop as soon as the first 3 } matches are found? Can't be done using glob patterns.