GNU bug report logs - #42211
Problem in sort

Previous Next

Package: coreutils;

Reported by: Richard Freedman <rfreedman <at> seti.org>

Date: Sun, 5 Jul 2020 06:22:01 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42211 in the body.
You can then email your comments to 42211 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#42211; Package coreutils. (Sun, 05 Jul 2020 06:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Richard Freedman <rfreedman <at> seti.org>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Sun, 05 Jul 2020 06:22:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Richard Freedman <rfreedman <at> seti.org>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Subject: Problem in sort
Date: Sat, 4 Jul 2020 21:39:46 +0000
[Message part 1 (text/plain, inline)]
When I use sort -n -c on a specified column in a file sort reports an error and then stops if two numbers are exactly the same. I want the sort to find actual sort errors, i.e. number (n+1) < number(n). This negates the use of sort -n -c on large files to find files that are actually out of order. Any way to fix this ?

regards,

Richard Freedman
rfreedman <at> seti.org<mailto:rfreedman <at> seti.org>

richard.s.freedman <at> nasa.gov<mailto:richard.s.freedman <at> nasa.gov>

[Message part 2 (text/html, inline)]

Information forwarded to bug-coreutils <at> gnu.org:
bug#42211; Package coreutils. (Sun, 05 Jul 2020 08:53:02 GMT) Full text and rfc822 format available.

Message #8 received at 42211 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Richard Freedman <rfreedman <at> seti.org>
Cc: 42211 <at> debbugs.gnu.org
Subject: Re: bug#42211: Problem in sort
Date: Sun, 5 Jul 2020 01:52:13 -0700
On 7/4/20 2:39 PM, Richard Freedman wrote:
> When I use sort -n -c on a specified column in a file sort reports an error and then stops if two numbers are exactly the same.

Could you send us the input, and the output of "sort --debug -n -c -k3"
(assuming you're using column 3)? My guess is that the output will explain the
symptoms you're seeing, but if not then we'd like to see the test case. Thanks.




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Mon, 06 Jul 2020 20:32:02 GMT) Full text and rfc822 format available.

Notification sent to Richard Freedman <rfreedman <at> seti.org>:
bug acknowledged by developer. (Mon, 06 Jul 2020 20:32:02 GMT) Full text and rfc822 format available.

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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Richard Freedman <rfreedman <at> seti.org>
Cc: 42211-done <at> debbugs.gnu.org
Subject: Re: bug#42211: Problem in sort
Date: Mon, 6 Jul 2020 13:31:42 -0700
On 7/5/20 9:53 PM, Richard Freedman wrote:

> I discovered that trying to use -c with --debug causes an error - but not in the version that I have
> on my mac laptop !

Ah, I had meant to suggest using --debug without -c.

> when I try to specify a "key" even for a file with only 1 column - the program stops on consecutive entries
> that are identical.

When all keys compare equal, 'sort' falls back on a last-resort comparison of
the entire line to break ties, and it's finding that your lines are out of
order. You don't want 'sort' to do that, so you should specify the -s (--stable)
option. -s is a GNU extension.

Closing the bug report, as this should fix the problem for you.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Aug 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 16 days ago.

Previous Next


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