bug-coreutils
[Top][All Lists]
Advanced

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

RE: is it a bug?


From: Voelker, Bernhard
Subject: RE: is it a bug?
Date: Tue, 2 Mar 2010 09:34:19 +0100

On 3/1/2010 5:58 PM, Eric Blake wrote:

> According to Igor Zakharoff on 3/1/2010 9:49 AM:
>> $ echo -e "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | sort
>> 
>> I somehow get
>> 
>> ru.unix.ftn /h
>> ru.unix /h
>> ru.unix.prog /h
>> 
>> Is it a bug?
>
> Nope.  I reproduced your results with the en_US locale, but not with the C
> locale.  Remember that in some locales, like en_US, whitespace is ignored
> as insignificant in collation.
>
> Try '... | LC_ALL=C sort' to see the difference.
> http://www.gnu.org/software/coreutils/faq/#Sort-does-not-sort-in-normal-order_0021


I understand that the sort order depends on the locale, i.e. LC_ALL,
but this doesn't explain the differences I get on Solaris 5.10, SLES 10.1,
and Cygwin (given that sort didn't change about this point in the past).

# === Solaris SunOS 5.10, sort 6.10 ===
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=C sort
ru.unix /h
ru.unix.ftn /h
ru.unix.prog /h
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=POSIX sort
ru.unix /h
ru.unix.ftn /h
ru.unix.prog /h
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=en_US sort
ru.unix /h
ru.unix.ftn /h
ru.unix.prog /h
$ sort --version
sort (GNU coreutils) 6.10
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.



# === SLES 10.1, kernel 2.6.16.60-0.23-smp, sort 5.93 ===
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=C sort
ru.unix /h
ru.unix.ftn /h
ru.unix.prog /h
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=POSIX sort
ru.unix /h
ru.unix.ftn /h
ru.unix.prog /h
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=en_US sort
ru.unix.ftn /h
ru.unix /h
ru.unix.prog /h
$ sort --version
sort (GNU coreutils) 5.93
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.



# === Cygwin on XPSP3, CYGWIN_NT-5.1 1.7.1(0.218/5/3), sort 7.0 ===
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=C sort
ru.unix /h
ru.unix.ftn /h
ru.unix.prog /h
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=POSIX sort
ru.unix /h
ru.unix.ftn /h
ru.unix.prog /h
$ printf "ru.unix /h\nru.unix.ftn /h\nru.unix.prog /h" | LC_ALL=en_US sort
ru.unix /h
ru.unix.ftn /h
ru.unix.prog /h
$ sort --version
sort (GNU coreutils) 7.0
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.


It seems that sort doesn't depend on LC_ALL on Solaris and Cygwin,
but it does on Linux. Besides LC_ALL, what does the sort order depend
on? Build settings?

Thank you & have a nice day,
Berny



reply via email to

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