Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: <x-y> globing pattern doesn't sort?

Louis-David Mitterrand wrote:
> Hello,
> 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-b
> k11.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 ../pat
> ch-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
> 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?

Yes.  However, you can set the option numeric_glob_sort.  A quick test
suggests completion will obey this, which does what you want.  Note that
that's independent of how the matches were generated, however, so
replacing <1-19> with * wouldn't change the result.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070

The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
If you received this in error, please contact the sender and 
delete the material from any computer.

Messages sorted by: Reverse Date, Date, Thread, Author