bug-coreutils
[Top][All Lists]
Advanced

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

Re: sort -u -n error : sort v 4.5.3


From: Paul Eggert
Subject: Re: sort -u -n error : sort v 4.5.3
Date: Sat, 04 Mar 2006 23:45:09 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

address@hidden (Eric Blake) writes:

> I think this does point out some bugs in POSIX
> compliance

I don't see any bugs.  In one case it appears you're misunderstanding
the POSIX requirements; in the other I don't observe the symptoms
that you do.

> $ sort -n blah  # lines with equal numeric keys should stay stable during sort

Not so.  Quoting from POSIX:

   Except when the -u option is specified, lines that otherwise
   compare equal shall be ordered as if none of the options -d, -f,
   -i, -n, or -k were present (but with -r still in effect, if it was
   specified) and with all bytes in the lines significant to the
   comparison.
   
So lines with equal numeric keys are sorted by ASCII value, which
is the behavior you observed.

> $ sort -nu blah # numeric keys do not include decimal points in LANG=C
> 0
> 64.202

I don't observe that behavior.  Here's the behavior that I get:

   $ sort -nu blah
   0
   64.201
   64.202
   64.203

which is correct.  (It would also be correct to output "-0" instead of
"0".)

Perhaps you could track down why your "sort" implementation behaves
differently?

My tests used sort (GNU coreutils) 5.94 on Solaris 10.




reply via email to

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