bug-textutils
[Top][All Lists]
Advanced

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

Re: BUG found in 'sort' command


From: Bob Proulx
Subject: Re: BUG found in 'sort' command
Date: Fri, 1 Mar 2002 22:15:24 -0700

> I have a textfile with this data in it:
> 
> 387 (Grade 4)     ~       1.24091
> 387 (Grade 4)     ~       1.10984
> 387 (Grade 41)    ~       1.10821
> 387 (Grade 4)     ~       1.81599
> 
> I cat the file and pipe it to sort. It does not sort correctly.
> 
> If i change the 41 to a 42 or any other number it sorts perfectly. I've 
> tested this many times and it is definatly a bug.

It is unlikely that you have found a bug in sort.  Here is a canned
reply.

Bob

Please check out the FAQ section on sort.

  
http://www.gnu.org/software/fileutils/doc/faq/#Sort%20does%20not%20sorting%20in%20normal%20order!

This is due to the fact that you or your vendor have set environment
variables that direct the program to use locale specific sorting
tables which do not sort as you expect. You or your vendor have
probably set environment variables like LANG, LC_ALL, or LANG to
en_US. There appears to be a problem with that table on some systems
which is not part of the GNU program but part of your vendor's system
release.

Unset them, and then set LC_ALL to POSIX. 

  # If you use bash or some other Bourne-based shell,
  export LC_ALL=POSIX

  # If you use a C-shell,
  setenv LC_ALL POSIX

and it will then work the way you expect because it will use a
different set of tables.

See the standards documentation for more information on the locale
variables with regards to sort.

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



reply via email to

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