[Top][All Lists]

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

Re: bug in sort 5.2.1

From: Bob Proulx
Subject: Re: bug in sort 5.2.1
Date: Fri, 24 Mar 2006 09:41:29 -0700
User-agent: Mutt/1.5.9i

address@hidden wrote:
> I have found what appears to be a bug in gnu sort 5.2.1, under Linux.
> The attached file is in UNIX format (no carriage returns).  It is -not-
> in sorted order.  Running 'sort sort.txt' produces output in the same
> order, ie unsorted.  If you have trouble reproducing this, please get
> back to me and I'll provide complete environmental information.  Thanks
> for your attention.

Thank you for your report.  But the file sorts fine for me.  I cannot
reproduce your problem.  But your report matches a very common
signature of other reports.

This is almost certainly due use of a non-standard locale.  For
example in the en_US locale setting (e.g. LANG=en_US) the collating
sequence of letters is aAbBcC...zZ and [a-z] matches [a-zA-X] in the C
or POSIX locale.  Also case is folded and punctuation is ignored.
Because punctuation is ingored in the locale this makes it appear as
if the file is not being sorted correctly when in actuality it is
being sorted correctly according to the chosen locale.

Try this:

  export LANG=C
  sort yourfile

See this reference:


Look for "Sort does not sort in normal order!"


reply via email to

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