Subject: sort -c not using proper keyspec

From: <[email-masked]>
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.