GNU bug report logs - #69901
(echo a; echo b) | sort -nu looses some data

Previous Next

Package: coreutils;

Reported by: Rafal Maszkowski <rzm <at> icm.edu.pl>

Date: Tue, 19 Mar 2024 18:26:04 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 69901-done <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Rafal Maszkowski <rzm <at> icm.edu.pl>
Cc: 69901-done <at> debbugs.gnu.org
Subject: Re: bug#69901: (echo a; echo b) | sort -nu looses some data
Date: Tue, 19 Mar 2024 15:07:01 -0700
On 3/19/24 08:33, Rafal Maszkowski wrote:
> he --debug option advised in
> README does not say anything helpful:
> 
> (echo a; echo b) | sort --debug -nu
> sort: text ordering performed using simple byte comparison
> a
> ^ no match for key

That diagnostic message is helpful. It's telling you that there's no 
number, so everything sorts as being the same, which means 'sort -nu' 
(correctly) outputs just one line.

'sort' has behaved this way for quite some time, and POSIX requires this 
behavior.




This bug report was last modified 1 year and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.