[Top][All Lists]

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

Re: question-problem with sort

From: Bob Proulx
Subject: Re: question-problem with sort
Date: Thu, 10 Mar 2005 10:01:56 -0700
User-agent: Mutt/1.5.6+20040907i

Paul Riggs wrote:
>         Is the "sort" command supposed to be case-sensitive? The info
> pages imply that it is, but it does not seem to be in various tests I've
> run on different versions of it including the current version (from
> coreutils-5.2.1).

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 in 'ls' either.

>         For example:
> >ls
> a B c
> >ls |sort
> a
> B
> c
> >ls |sort -f
> a
> B
> c

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.


The systems you mention above are probably setting LANG to a
dictionary sort order locale without your knowledge.  (I wish they
would not do that.)

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


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


Hope that helps,

reply via email to

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