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

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

[Emacs-bug-tracker] bug#6296: closed (sort -c not using proper keyspec)


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#6296: closed (sort -c not using proper keyspec)
Date: Sat, 29 May 2010 23:37:02 +0000

Your message dated Sun, 30 May 2010 00:32:52 +0100
with message-id <address@hidden>
and subject line Re: bug#6296: sort -c not using proper keyspec
has caused the GNU bug report #6296,
regarding sort -c not using proper keyspec
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
6296: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6296
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: sort -c not using proper keyspec Date: Fri, 28 May 2010 14:04:44 -0600
CoreUtils,

I believe sort(1) is not honoring the keyspec I provide in the case of a '-c' 
run. Here's a small file and the behavior I'm seeing.

I realize sort keyspecs can be tricky -- I hope this is not a case of user 
error!

Thanks,
Jim

$ head -5 x.scan.txt
1 5242857 + 25 1
1 15728631 + 25 1
1 17825783 + 25 1
1 36700126 + 50 1
1 36700126 + 47 1

$ awk '{print $1,$2}' x.scan.txt|sort -c -k1,1n -k2,2n

$ sort -c -k1,1n -k2,2n x.scan.txt
sort: x.scan.txt:5: disorder: 1 36700126 + 47 1

$ sort --version
sort (GNU coreutils) 8.5
Packaged by Cygwin (8.5-1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.



--- End Message ---
--- Begin Message --- Subject: Re: bug#6296: sort -c not using proper keyspec Date: Sun, 30 May 2010 00:32:52 +0100 User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
tags 6296 + notabug

On 28/05/10 21:04, address@hidden wrote:
> CoreUtils,
> 
> I believe sort(1) is not honoring the keyspec I provide in the case of a '-c' 
> run. Here's a small file and the behavior I'm seeing.
> 
> I realize sort keyspecs can be tricky -- I hope this is not a case of user 
> error!
> 
> Thanks,
> Jim
> 
> $ head -5 x.scan.txt
> 1 5242857 + 25 1
> 1 15728631 + 25 1
> 1 17825783 + 25 1
> 1 36700126 + 50 1
> 1 36700126 + 47 1
> 
> $ awk '{print $1,$2}' x.scan.txt|sort -c -k1,1n -k2,2n
> 
> $ sort -c -k1,1n -k2,2n x.scan.txt
> sort: x.scan.txt:5: disorder: 1 36700126 + 47 1
> 
> $ sort --version
> sort (GNU coreutils) 8.5
> Packaged by Cygwin (8.5-1)

The next released version of coreutils will have
the sort --debug option which illustrates what's happening:

$ sort --debug -c -k1,1n -k2,2n x.scan.txt
sort: using `en_IE.UTF-8' sorting rules
sort: x.scan.txt:5: disorder:
1 36700126 + 47 1
_
  ________
_________________


So the last resort comparison is causing the issue,
and you can disable that by also specifying the -s option.

cheers,
Pádraig.


--- End Message ---

reply via email to

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