emacs-bug-tracker
[Top][All Lists]
Advanced

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

[Emacs-bug-tracker] bug#9281: closed (Is this expected behavior?)


From: GNU bug Tracking System
Subject: [Emacs-bug-tracker] bug#9281: closed (Is this expected behavior?)
Date: Thu, 11 Aug 2011 12:07:02 +0000

Your message dated Thu, 11 Aug 2011 06:04:48 -0600
with message-id <address@hidden>
and subject line Re: bug#9281: Is this expected behavior?
has caused the GNU bug report #9281,
regarding Is this expected behavior?
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
9281: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9281
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: Is this expected behavior? Date: Thu, 11 Aug 2011 12:01:38 +0530 Hi,

    I got a strange ordering when I applied the linux sort command. Please see below for the details:

address@hidden tmp]$ cat a
.a
ba
.b
bb
.c
bc
address@hidden tmp]$ sort a
.a
.b
ba
bb
bc
.c


NOTE: .a and .b appears before ba and bb, where as .c appears after bc.

In general

if the file has strings of the type .<x> and <y><x>,

then for all x <= y, .x appear before yx and
          for all x>y, .x appear after yx

Is this expected behavior?

Regards
Ajesh

--


--- End Message ---
--- Begin Message --- Subject: Re: bug#9281: Is this expected behavior? Date: Thu, 11 Aug 2011 06:04:48 -0600 User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110621 Fedora/3.1.11-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.11
tag 9281 notabug
thanks

On 08/11/2011 12:31 AM, Ajesh Shaj wrote:
Hi,

     I got a strange ordering when I applied the linux sort command. Please see 
below for the details:

address@hidden tmp]$ sort a
.a
.b
ba
bb
bc
.c


NOTE: .a and .b appears before ba and bb, where as .c appears after bc.

> Is this expected behavior?

Yep. And this is a FAQ, caused by you using a locale that ignores punctuation when determining sort order.

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

If you are using new enough coreutils, try:

sort --debug a

for better understanding what is happening, then compare to:

LC_ALL=C sort --debug a

(if your sort doesn't understand --debug, then it is still useful to try LC_ALL=C sort a).

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--- End Message ---

reply via email to

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