Subject: bug#19021: Possible bug in sort

From: Eric Blake <[email-masked]>
Date: Tue, 11 Nov 2014 12:29:33 -0700

On 11/11/2014 11:27 AM, Leslie S Satenstein wrote:

[please don't top-post on technical lists - it makes it harder to figure
out what you are asking]

> Why not have used  sort  -t ',' -k 1n  ?

> 
>>
>> This results in line 7 being sorted incorrectly: sort -t , -k 1n < weird.csv

Are you asking the difference between:

sort -t , -k 1n
sort -t ',' -k 1n

If so, there's no difference.  The shell strips the '' quoting around ,
before invoking sort, so argv[] is the same in either spelling from the
shell.

But that has nothing to do with the bug report, where the answer is that
the caller should have been using:

sort -t , -k 1,1n

or

LC_ALL=C sort -t , -k 1n

or the combination:

LC_ALL=C sort -t , -k 1,1n

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org