zsh-users
 help / color / mirror / code / Atom feed
* Re: <> doesn't sort numerically
@ 1995-11-13 18:29 Steven L. Baur
  0 siblings, 0 replies; 3+ messages in thread
From: Steven L. Baur @ 1995-11-13 18:29 UTC (permalink / raw)
  To: zsh-users

>>>>> "Peter" == P Stephenson <P.Stephenson@swansea.ac.uk> writes:

    Peter> steve@miranova.com 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.

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

O.K.  Thanks. The version of the manual I was looking at, made no
mention of this option in the globbing section.

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

Yes.  Especially since a semi-clueless person could always bruteforce
the current behavior with $(ls <>).  Although, I suppose, the same
could be said for $(sort -n <>).

Thank you Thorsten (private mail), and Peter for responding.
-- 
steve@miranova.com baur


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: <> doesn't sort numerically
  1995-11-13  4:45 Steven L. Baur
@ 1995-11-13  8:14 ` P.Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: P.Stephenson @ 1995-11-13  8:14 UTC (permalink / raw)
  To: Steven L. Baur; +Cc: Zsh users list

steve@miranova.com 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@ifh.de>       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.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* <> doesn't sort numerically
@ 1995-11-13  4:45 Steven L. Baur
  1995-11-13  8:14 ` P.Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Steven L. Baur @ 1995-11-13  4:45 UTC (permalink / raw)
  To: zsh-users

(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.

Renaming files is definitely not an option, I'm working with news
spool directories and mh folders.

Has this been fixed in a newer beta?

Regards,
-- 
steve@miranova.com baur


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1995-11-13 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-11-13 18:29 <> doesn't sort numerically Steven L. Baur
  -- strict thread matches above, loose matches on Subject: below --
1995-11-13  4:45 Steven L. Baur
1995-11-13  8:14 ` P.Stephenson

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).