[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sort -nu: bug or feature?
From: |
Andreas Schwab |
Subject: |
Re: sort -nu: bug or feature? |
Date: |
Thu, 09 Sep 2004 15:29:33 +0200 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
"Chris F.A. Johnson" <address@hidden> writes:
> "sort -n" uses a string comparison after aligning the numbers on
> the decimal point, but -u apparently uses a (non-POSIX) numeric
> comparison to determine equivalency:
>From POSIX.1-2003:
-n
Restrict the sort key to an initial numeric string, consisting of
optional <blank>s, optional minus sign, and zero or more digits with an
optional radix character and thousands separators (as defined in the
current locale), which shall be sorted by arithmetic value. An empty
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
digit string shall be treated as zero. Leading zeros and signs on zeros
shall not affect ordering.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Re: sort -nu: bug or feature?, Paul Eggert, 2004/09/08
Re: sort -nu: bug or feature?, Stepan Kasal, 2004/09/09