emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#69901: closed ((echo a; echo b) | sort -nu looses some data)


From: GNU bug Tracking System
Subject: bug#69901: closed ((echo a; echo b) | sort -nu looses some data)
Date: Tue, 19 Mar 2024 22:08:01 +0000

Your message dated Tue, 19 Mar 2024 15:07:01 -0700
with message-id <4bec3b35-29ee-4397-a64a-0ddf44d215aa@cs.ucla.edu>
and subject line Re: bug#69901: (echo a; echo b) | sort -nu looses some data
has caused the debbugs.gnu.org bug report #69901,
regarding (echo a; echo b) | sort -nu  looses some data
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
69901: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69901
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: (echo a; echo b) | sort -nu looses some data Date: Tue, 19 Mar 2024 16:33:09 +0100
Sort with -n and -u options works correctly for numbers:

(echo 10; echo 11) | sort -nu
10
11

but looses data when used with non-numbers:

(echo a; echo b) | sort -nu
a

(echo 1.0; echo 1.1) | sort -nu
1.0

I have tested this on versions 8.32 and 9.2 default for Debian 11 and
12, and additionally compiled version 9.4. The --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

R.
-- 
„Walczy on z całym zapamiętaniem przeciwko intelektowi” - z akt personalnych 
prof. A. Baeumlera



--- End Message ---
--- Begin Message --- Subject: Re: bug#69901: (echo a; echo b) | sort -nu looses some data Date: Tue, 19 Mar 2024 15:07:01 -0700 User-agent: Mozilla Thunderbird
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.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]