GNU bug report logs -
#76290
"sort -u" vs "sort -h -u": possible bug
Previous Next
Full log
Message #28 received at 76290-done <at> debbugs.gnu.org (full text, mbox):
On 2025-02-17 15:13, Rupert Gallagher via GNU coreutils Bug Reports wrote:
> I expect the program to do exactly what the manual says.
Here's what the manual says about -u in
<https://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html#index-uniquifying-output>:
> Normally, output only the first of a sequence of lines that compare equal....
>
> This option also disables the default last-resort comparison.
>
> The commands sort -u and sort | uniq are equivalent, but this equivalence does not extend to arbitrary sort options. For example, sort -n -u inspects only the value of the initial numeric string when checking for uniqueness, whereas sort -n | uniq inspects the entire line.
This is the part of the manual that you're disagreeing with. The example
in my previous email (an example that you did not reply to) is a
demonstration of this part of the manual.
I am taking the liberty of closing this bug report, as "sort" is
behaving as documented here.
This bug report was last modified 92 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.