[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sort -u -n error : sort v 4.5.3
From: |
Eric Blake |
Subject: |
Re: sort -u -n error : sort v 4.5.3 |
Date: |
Wed, 08 Mar 2006 12:39:37 -0000 |
User-agent: |
Thunderbird 1.5 (Windows/20051201) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Paul Eggert on 3/5/2006 12:45 AM:
>
> 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.
I stand corrected. Sorry for the false alarm, GNU sort is correctly doing
the specified behavior.
>
>> $ 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.
Point taken. I missed that line in my first reading, since it was
indented as though it applied only when -k was in effect.
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEDtB/84KuGfSFAYARAr0YAKDXmTaQTBMm7CsRlEDBBXDVYy3WFACcCSNs
ls6fIzhtrgHbmth4kFzUnkU=
=Hzl/
-----END PGP SIGNATURE-----