From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23227 invoked from network); 13 Sep 2004 16:02:07 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 13 Sep 2004 16:02:07 -0000 Received: (qmail 68292 invoked from network); 13 Sep 2004 16:01:48 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 13 Sep 2004 16:01:48 -0000 Received: (qmail 21121 invoked by alias); 13 Sep 2004 16:01:40 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7981 Received: (qmail 21111 invoked from network); 13 Sep 2004 16:01:39 -0000 Received: from unknown (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 13 Sep 2004 16:01:39 -0000 Received: (qmail 64743 invoked from network); 13 Sep 2004 16:00:40 -0000 Received: from mail36.messagelabs.com (193.109.254.211) by a.mx.sunsite.dk with SMTP; 13 Sep 2004 16:00:38 -0000 X-VirusChecked: Checked X-Env-Sender: okiddle@yahoo.co.uk X-Msg-Ref: server-5.tower-36.messagelabs.com!1095091237!9287219 X-StarScan-Version: 5.2.10; banners=-,-,- X-Originating-IP: [158.234.9.163] Received: (qmail 22451 invoked from network); 13 Sep 2004 16:00:37 -0000 Received: from iris.logica.co.uk (158.234.9.163) by server-5.tower-36.messagelabs.com with SMTP; 13 Sep 2004 16:00:37 -0000 Received: from trentino.logica.co.uk ([158.234.142.61]) by iris.logica.co.uk (8.12.3/8.12.3/Debian -4) with ESMTP id i8DG0bSt029357; Mon, 13 Sep 2004 17:00:37 +0100 Received: from trentino.logica.co.uk (localhost [127.0.0.1]) by trentino.logica.co.uk (Postfix) with ESMTP id CBD35791B004; Mon, 13 Sep 2004 18:00:36 +0200 (CEST) Cc: zsh-users@sunsite.dk X-VirusChecked: Checked X-StarScan-Version: 5.0.7; banners=.,-,- In-reply-to: <20040913152958.GA19979@apartia.fr> From: Oliver Kiddle References: <20040913152958.GA19979@apartia.fr> To: Louis-David Mitterrand Subject: Re: globing pattern doesn't sort? Date: Mon, 13 Sep 2004 18:00:36 +0200 Message-ID: <6353.1095091236@trentino.logica.co.uk> 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=BAYES_50 autolearn=no version=2.63 X-Spam-Hits: 0.0 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. > 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) Oliver