Subject: bug#76290: closed (Re: bug#76290: "sort -u" vs "sort -h -u": possible bug)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 18 Feb 2025 06:26:02 +0000

Your bug report

#76290: "sort -u" vs "sort -h -u": possible bug

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
76290: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76290
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#76290: "sort -u" vs "sort -h -u": possible bug
From: Paul Eggert <[email-masked]>
To: Rupert Gallagher <[email-masked]>
Cc: [email-masked]
Date: Mon, 17 Feb 2025 22:25:12 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

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.

Subject: "sort -u" vs "sort -h -u": possible bug
From: Rupert Gallagher <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Fri, 14 Feb 2025 15:44:34 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

>echo -e "CVE-2018-13787\nCVE-2019-16649\nCVE-2019-16650\nCVE-2020-15046\nCVE-2018-13787"
CVE-2018-13787 <---
CVE-2019-16649
CVE-2019-16650
CVE-2020-15046CVE-2018-13787 <---

>echo -e "CVE-2018-13787\nCVE-2019-16649\nCVE-2019-16650\nCVE-2020-15046\nCVE-2018-13787" | sort
CVE-2018-13787 <---
CVE-2018-13787 <---
CVE-2019-16649
CVE-2019-16650
CVE-2020-15046

>echo -e "CVE-2018-13787\nCVE-2019-16649\nCVE-2019-16650\nCVE-2020-15046\nCVE-2018-13787" | sort -u
CVE-2018-13787 <---
CVE-2019-16649
CVE-2019-16650
CVE-2020-15046

Problem:

>echo -e "CVE-2018-13787\nCVE-2019-16649\nCVE-2019-16650\nCVE-2020-15046\nCVE-2018-13787" | sort -h -uCVE-2018-13787