GNU bug report logs - #14318
sort: unexpected results

Previous Next

Package: coreutils;

Reported by: Kenneth Dickman <kenneth.dickman <at> citrix.com>

Date: Tue, 30 Apr 2013 01:48:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 14318 in the body.
You can then email your comments to 14318 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#14318; Package coreutils. (Tue, 30 Apr 2013 01:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Kenneth Dickman <kenneth.dickman <at> citrix.com>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Tue, 30 Apr 2013 01:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Kenneth Dickman <kenneth.dickman <at> citrix.com>
To: "bug-coreutils <at> gnu.org" <bug-coreutils <at> gnu.org>
Cc: Kenneth Dickman <kenneth.dickman <at> citrix.com>,
	Vijay Patel <Vijay.Patel <at> citrix.com>
Subject: sort: unexpected results
Date: Mon, 29 Apr 2013 18:37:10 -0700
Why does putting "depot" in the input file, corrupt the sort function? How can I get sort to operate properly?

$ cat good
bin/... //b/bin/...
logs/... //logs/...
... //b/...
$ sort good
... //b/...
bin/... //b/bin/...
logs/... //logs/...
$ cat bad
bin/... //depot/b/bin/...
logs/... //depot/logs/...
... //depot/b/...
$ sort bad
bin/... //depot/b/bin/...
... //depot/b/...
logs/... //depot/logs/...
$

This occurs on RedHat:

$ uname -a
Linux hidden-name 2.6.32-71.15.1.el6.x86_64 #1 SMP Sun Jan 23 10:39:44 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
$ which sort
/bin/sort
$ file /bin/sort
/bin/sort: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped
$

And on Linux Mint (which is on top of Ubuntu):

$ uname -a
Linux hidden_name 3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
$ which sort
/usr/bin/sort
$

Thanks for your help!
Ken




Information forwarded to bug-coreutils <at> gnu.org:
bug#14318; Package coreutils. (Tue, 30 Apr 2013 08:41:02 GMT) Full text and rfc822 format available.

Message #8 received at 14318 <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: Kenneth Dickman <kenneth.dickman <at> citrix.com>
Cc: Vijay Patel <Vijay.Patel <at> citrix.com>, 14318 <at> debbugs.gnu.org
Subject: Re: bug#14318: sort: unexpected results
Date: Tue, 30 Apr 2013 09:40:14 +0100
tag 14318 notabug
stop

On 04/30/2013 02:37 AM, Kenneth Dickman wrote:
> Why does putting "depot" in the input file, corrupt the sort function? How can I get sort to operate properly?
> 
> $ cat good
> bin/... //b/bin/...
> logs/... //logs/...
> ... //b/...
> $ sort good
> ... //b/...
> bin/... //b/bin/...
> logs/... //logs/...
> $ cat bad
> bin/... //depot/b/bin/...
> logs/... //depot/logs/...
> ... //depot/b/...
> $ sort bad
> bin/... //depot/b/bin/...
> ... //depot/b/...
> logs/... //depot/logs/...
> $
> 
> This occurs on RedHat:

This is because in your locale, punctuation is ignored in the presence
of other sort data. I.E. '.' and ' ' are not significant to the sort.
To turn off the locale specific sorting you need to use something like:
LC_ALL=C sort ...

http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-not-sort-in-normal-order_0021

thanks,
Pádraig.




Added tag(s) notabug. Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 19 Oct 2018 00:26:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 14318 <at> debbugs.gnu.org and Kenneth Dickman <kenneth.dickman <at> citrix.com> Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Fri, 19 Oct 2018 00:26:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 16 Nov 2018 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 217 days ago.

Previous Next


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