[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#17099: Does sort have a bug?
From: |
Eric Blake |
Subject: |
bug#17099: Does sort have a bug? |
Date: |
Wed, 26 Mar 2014 10:28:19 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
tag 17099 notabug
thanks
On 03/26/2014 07:42 AM, Prem Thoppae wrote:
> include/CFixFX_Server.h
> ../include/CFxBaseMsg.h
> include/CFXBookManager.h
>
> I am expecting for all the ../include's to bunch up before or after all
> the include's. But, the above is already in sorted order, according to
> sort! Something doesn't seem right. Is there a bug?
Not a bug, but a FAQ:
https://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-not-sort-in-normal-order_0021
You probably sorted in the en_US.UTF-8 locale (or related), where that
locale is defined to do dictionary collation where punctuation is
ignored. Since '../' is punctuation, it is ignored and does not affect
the sort. If you want every byte to affect the sort, choose a different
locale, as in:
LC_ALL=C sort ...
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature