bug-coreutils
[Top][All Lists]
Advanced

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

Re: sort not sorting right?


From: Bertram Franz
Subject: Re: sort not sorting right?
Date: Mon, 28 Feb 2005 10:47:07 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8b) Gecko/20050204

Bob,

thanks a lot for your answer. You were right, LANG=en_US.UTF-8 on all these systems, and that is propagated to all the other LC vars. Unsetting or setting to POSIX helped. So after all this is a bug in the en_US collation table, maintained by SuSE or Novell?

Anyway, I will now include LC_COLLATE=POSIX in all machine's profiles ...

Thanks again.

Bertram

Bertram Franz wrote:
I have an issue with sort. A file

Thanks for the report.  It is most appreciated.  However it matches a
very common problem signature which is not usually a bug in sort.  (Or
ls either.)

A:B
A:F
AC:B

is, in my eyes already sorted correctly. When running it through sort (no options), it comes back with

A:B
AC:B
A:F

Somehow it acts as if -d was specified, but it wasn't. I experimented with the -t : option, no success.

It sorts according to your 'locale'.  What is the output of the locale
program on your system?  Some locales are dictionary sort order where
case is folded and punctuation is ignored.

 locale

How can I sort a file without ignoring colons, or tabs, or spaces?

I tried on different machines with
textutils-2.0.14-2 (RHES 2.1)
coreutils-5.2.1-31 (Fedora Core 3)
coreutils-5.2.1-32 (SuSE 9.2)

The systems you mention above are probably setting LANG without your
knowledge by default.  (I wish they would not do that.)

On an HP-UX machine I get the desired result ...

HP-UX does not set LANG by default.  I am sure your local there is C
or POSIX giving you a standard environment there.  Run 'locale' to
check.

This is an FAQ.  Here is a semi-standard reply:

Try this and then try your test again.

 unset LANG
 export LC_ALL=POSIX

Please read this faq, look for "Sort does not sort" for the entry in
question.

 http://www.gnu.org/software/coreutils/faq/

See your system and other standards documentation for how it reacts in
the presence of locales.

 http://www.unix-systems.org/single_unix_specification_v2/xcu/sort.html

Hope that helps,
Bob





reply via email to

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