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.




Reply via email to