From: Peter William Stephenson <pws@ifh.de>
To: steve@miranova.com (Steven L. Baur)
Cc: zsh-workers@math.gatech.edu (Zsh hackers list)
Subject: Re: <> doesn't sort numerically
Date: Tue, 14 Nov 1995 11:06:39 +0100 [thread overview]
Message-ID: <9511141006.AA09110@sgi.ifh.de> (raw)
In-Reply-To: "steve@miranova.com"'s message of "13 Nov 1995 10:29:51 MET." <m2ivkoqsf4.fsf@diana.miranova.com>
steve@miranova.com wrote:
> 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 <>).
I'm inclined to agree. Unfortunately, I've looked at the source and
it's not that easy: the code for <> just checks for a number and adds
the file name to the list, while sorting of names happens altogether
at the end. I'll try and think of a way of doing it. I doubt if it's
worth rewriting the code to order the files as we go along just to
achieve this.
As you mentioned, the manual doesn't talk about NUMERIC_GLOB_SORT in
the globbing section, which is a mistake. Here's an addition.
*** Doc/zshexpn.1.num Tue Nov 7 04:44:02 1995
--- Doc/zshexpn.1 Tue Nov 14 11:02:41 1995
***************
*** 376,381 ****
--- 376,386 ----
matches the files "." or "..". In other instances of pattern
matching, the / and . are not treated specially.
.PP
+ Normally, sorting occurs in straightforward lexical order. However,
+ if the option \fBNUMERIC_GLOB_SORT\fP is set, any numbers contained
+ within a pattern. however matched, will be sorted numerically. This
+ does not affect the ordering of separate words on the command line.
+ .PP
.RS
.PD 0
.TP
--
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.
parent reply other threads:[~1995-11-14 10:42 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <m2ivkoqsf4.fsf@diana.miranova.com>]
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=9511141006.AA09110@sgi.ifh.de \
--to=pws@ifh.de \
--cc=steve@miranova.com \
--cc=zsh-workers@math.gatech.edu \
/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).