bug-coreutils
[Top][All Lists]
Advanced

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

bug#19021: Possible bug in sort


From: Eric Blake
Subject: bug#19021: Possible bug in sort
Date: Tue, 11 Nov 2014 12:29:33 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0

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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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