GNU bug report logs - #19021
Possible bug in sort

Previous Next

Package: coreutils;

Reported by: Ben Mendis <dragonwisard <at> gmail.com>

Date: Tue, 11 Nov 2014 16:42:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eric Blake <eblake <at> redhat.com>
To: Leslie S Satenstein <lsatenstein <at> yahoo.com>, Ben Mendis <dragonwisard <at> gmail.com>, "19021-done <at> debbugs.gnu.org" <19021-done <at> debbugs.gnu.org>
Subject: bug#19021: Possible bug in sort
Date: Tue, 11 Nov 2014 12:29:33 -0700
[Message part 1 (text/plain, inline)]
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

[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 10 years and 191 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.