bug#42211: Problem in sort

2020-07-06 Thread Paul Eggert
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#42211: Problem in sort

2020-07-05 Thread Paul Eggert
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.





bug#42211: Problem in sort

2020-07-05 Thread Richard Freedman
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
rfreed...@seti.org

richard.s.freed...@nasa.gov