zsh-users
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <okiddle@yahoo.co.uk>
To: Louis-David Mitterrand <vindex@apartia.org>
Cc: zsh-users@sunsite.dk
Subject: Re: <x-y> globing pattern doesn't sort?
Date: Mon, 13 Sep 2004 18:00:36 +0200	[thread overview]
Message-ID: <6353.1095091236@trentino.logica.co.uk> (raw)
In-Reply-To: <20040913152958.GA19979@apartia.fr>

Louis-David Mitterrand wrote:
> I just tried that:
> 
> % bzcat ../patch-2.6.9-rc1.bz2 ../patch-2.6.9-rc1-bk<1-19>.bz2<TAB>
> 
> 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


  reply	other threads:[~2004-09-13 16:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-13 15:29 Louis-David Mitterrand
2004-09-13 16:00 ` Oliver Kiddle [this message]
2004-09-14  7:20   ` Louis-David Mitterrand
2004-09-13 16:10 ` Peter Stephenson
2004-09-14  7:26   ` Louis-David Mitterrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6353.1095091236@trentino.logica.co.uk \
    --to=okiddle@yahoo.co.uk \
    --cc=vindex@apartia.org \
    --cc=zsh-users@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).