Subject: bug#23951: sort -k1.4,1.6n -u HAVE BUGS!!!

From: Assaf Gordon <[email-masked]>
Date: Tue, 12 Jul 2016 00:27:38 -0400

Hello,

> On Jul 11, 2016, at 21:38, David Pan <[email-masked]> wrote:
> 
> It seems that I find a bug when using the command:
> 
> sort -k1.4n -u
> please refer to the attachment for detail .

You have not indicated exactly what is the suspected incorrect output.
May I ask you to detail what is the output you expected vs the output you got? (i.e. in which command you think the bug is?) Also, in the subject line you've listed "-k1.4,1.6n", but I do not see such invocation in the attached file.

To help troubleshoot sort-related issues, recent versions of gnu sort support a new option "--debug" which prints additional information about the keys being compared.
It would be useful to attach the output of such command, for example:

======
$ sort --debug -k1.4n -u aa 
sort: using ‘en_US.UTF-8’ sorting rules
sort: leading blanks are significant in key 1; consider also specifying 'b'
sort: key 1 is numeric and spans multiple fields
c3a1.ecld.com
   __
c3m2.ecld.com
   __
c3s15.ecld.com
   ___
c3s16.ecld.com
   ___
c3s17.ecld.com
   ___
c3s18.ecld.com
   ___
c3s19.ecld.com
   ___
c3s20.ecld.com
   ___
c3s21.ecld.com
   ___
c3s25.ecld.com
   ___

======

regards,
 -assaf

P.S.
If you do test a newer version of coreutils, please be sure to use version 8.19 or newer, as it contains a fix for a "sort -u" bug which was introduced in 8.6 ( http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=eb3f5b3b3de8c6ca005a701f09bff43d778aece7 ).