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

Re: <> doesn't sort numerically

steve@xxxxxxxxxxxx wrote:
> (zsh 2.6 beta 9).
> I've noticed that <> doesn't appear to order the expanded files in
> numeric order.  Eg.  <> in a directory containing 1 2 4 9 24 will
> expand as 1 2 24 4 9.  This isn't completely useful behavior.
> The only workaround I've found is to use a succession of ? ?? ???, etc.

You have to set the option `numericglobsort'.  This actually means you
get the same result however the numbers are matched, with * or <> for
example.  I think this was some unusual attempt at consistency.

Perhaps it's actually a bit counterintuitive.  Would it actually be
more sensible for <> always to produce globbing in numerical order?  I
haven't looked at the source but presumably it's not too hard.

Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77330
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.

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