From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1180 invoked from network); 14 Sep 2004 07:22:07 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 14 Sep 2004 07:22:07 -0000 Received: (qmail 4444 invoked from network); 14 Sep 2004 07:21:59 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 14 Sep 2004 07:21:59 -0000 Received: (qmail 1258 invoked by alias); 14 Sep 2004 07:21:15 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7986 Received: (qmail 1242 invoked from network); 14 Sep 2004 07:21:14 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 14 Sep 2004 07:21:14 -0000 Received: (qmail 3251 invoked from network); 14 Sep 2004 07:21:14 -0000 Received: from zenon.apartia.fr (HELO zenon.apartia.com) (82.66.93.83) by a.mx.sunsite.dk with SMTP; 14 Sep 2004 07:21:12 -0000 Received: from pyrrhus.apartia.fr (pyrrhus.apartia.fr [10.0.3.101]) by zenon.apartia.com (Postfix) with ESMTP id 66B4A1859D1 for ; Tue, 14 Sep 2004 09:21:12 +0200 (CEST) Received: by pyrrhus.apartia.fr (Postfix, from userid 1000) id 4972A9728F; Tue, 14 Sep 2004 09:20:55 +0200 (CEST) Date: Tue, 14 Sep 2004 09:20:55 +0200 From: Louis-David Mitterrand To: zsh-users@sunsite.dk Subject: Re: globing pattern doesn't sort? Message-ID: <20040914072054.GA15962@apartia.fr> Mail-Followup-To: zsh-users@sunsite.dk References: <20040913152958.GA19979@apartia.fr> <6353.1095091236@trentino.logica.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6353.1095091236@trentino.logica.co.uk> User-Agent: Mutt/1.5.6+20040818i 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=none autolearn=no version=2.63 X-Spam-Hits: 0.0 On Mon, Sep 13, 2004 at 06:00:36PM +0200, Oliver Kiddle wrote: > Louis-David Mitterrand wrote: > > I just tried that: > > > > % bzcat ../patch-2.6.9-rc1.bz2 ../patch-2.6.9-rc1-bk<1-19>.bz2 > > > > and obtained: > > > > bzcat ../patch-2.6.9-rc1.bz2 ../patch-2.6.9-rc1-bk10.bz2 ../patch-2.6.9-rc1-bk11.bz2 ../patch-2.6.9-rc1-bk12.bz2 ../patch-2.6.9-rc1-bk13.bz2 ../patch-2.6.9-rc1-bk14.bz2 ../patch-2.6.9-rc1-bk15.bz2 ../patch-2.6.9-rc1-bk16.bz2 ../patch-2.6.9-rc1-bk17.bz2 ../patch-2.6.9-rc1-bk18.bz2 ../patch-2.6.9-rc1-bk19.bz2 ../patch-2.6.9-rc1-bk1.bz2 ../patch-2.6.9-rc1-bk2.bz2 ../patch-2.6.9-rc1-bk3.bz2 ../patch-2.6.9-rc1-bk4.bz2 ../patch-2.6.9-rc1-bk5.bz2 ../patch-2.6.9-rc1-bk6.bz2 ../patch-2.6.9-rc1-bk7.bz2 ../patch-2.6.9-rc1-bk8.bz2 ../patch-2.6.9-rc1-bk9.bz2 > > Is it the order of the expansions that surprised you. It often helps us > understand a point like this if you state what you expected to obtain. Right, I expected the list to be numerically sorted. Actually I now understand <-> is a way to state a range and has nothing to do with sorting. > > which really suprised my as I thought the whole point of the <-> pattern > > was to allow for an ordered sequence to be returned (contrary to a > > simple *). > > > > Am I mistaken in that belief? > > <-> doesn't expand a sequence in order. Like *, it is just matching > filenames except it looks for a number within a range. Files are matched > and then sorted. > > You could use {1..19} for an ordered expansion but that expands > unconditionally: there doesn't need to be existing files with each name > in the sequence. > > Alternatively, you can use the (n) glob qualifier to sort the > expansions numerically: > patch*(n) Hey, thanks for these snippets. I learned two new tricks today. Best regards, -- Hi, I am an alien .sig, and at the moment I am having sex to your mind, by looking at your smile I can see that you like it.