[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sort Bug

From: Paul Eggert
Subject: Re: Sort Bug
Date: 30 Oct 2003 10:06:17 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

Thanks for following up on this.  I now see the problem; it's not a
bug in "sort" after all.  Your output was sorted as you desired until
the numbers got too wide for their columns.  Thus, for example, with
this input:

-rw-r--r--    1 robertd  users     2587029 Aug 27 11:40 printfbin270803.gz
-rwxr-xr-x    1 robertd  users    1127596442 Oct 29 11:03 tms_mp2.zip
-rw-r-----    1 robertd  users    15035855 Aug 27 11:16 backuptest270803.gz

the three keys are as follows:

"     2587029 Aug 27 11:40 printfbin270803.gz"
"    1127596442 Oct 29 11:03 tms_mp2.zip"
"    15035855 Aug 27 11:16 backuptest270803.gz"

These lines are sorted correctly, as
"     2" precedes
"    11" which in turn precedes
"    15" in a lexicographic sort.

Sorry about my confusion.  Anyway, a numeric sort ("sort -k 5n")
should do what you originally wanted.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]