Thank you for your response. Unfortunately, this is *not* a bug in sort.
What happens is that the locale affects sorting order: some countries
have decided -- e.g., the US -- that sort should order in dictionary
order, *not* in collating sequence order. Please see
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-
not-sort-in-normal-order_0021.

As such, I am closing this bug INVALID (i.e., not a bug).

Unfortunately, I do not have a 9.10 available to verify, but on Lucid
(soon-to-be 10.04 LTS), 'man sort' has this warning:

"***  WARNING *** The locale specified by the environment affects sort
order.  Set LC_ALL=C to get the traditional sort order that uses native
byte values.". Please also note that the man page for sort has an
abridged documentation; the full documentation for sort, and all of
cureutils is available under 'info':

info coreutils '<utility> invocation'

Replacing <utility> by the appropriate name.

** Changed in: coreutils (Ubuntu)
       Status: Incomplete => Invalid

** Description changed:

  Binary package hint: coreutils
  
  Description:  Ubuntu 9.10
  Release:      9.10
  
- coreutils:
-   Installed: 7.4-2ubuntu1
-   Candidate: 7.4-2ubuntu1
-   Version table:
-  *** 7.4-2ubuntu1 0
-         500 http://us.archive.ubuntu.com karmic/main Packages
-         100 /var/lib/dpkg/status
+  karmic/main Packages
  
  I ran 'sort' on the following lines of data:
  EAS18:1:1:100:1001:557:0/2
  EAS18:1:1:100:100:1572:0/1
  EAS18:1:1:100:1001:572:0/1
  EAS18:1:1:100:100:1572:0/2
  EAS18:1:1:100:1001:572:0/2
  EAS18:1:1:100:1001:578:0/1
  EAS18:1:1:100:1001:578:0/2
  
  and expected to get a lexicographically sorted version of them but got
  exactly those in this order. In fact this is the core of a bug in a
  scientific project.
  
  By checking the GNU sort website, I realized that the problem is solved
  if I set LC_ALL=C. But please do fix this in Ubuntu as it is gravely
  misleading because currently sort almost sorts!!! This is more dangerous
  than not sorting at all.
+ 
+ WORKAROUND:
+ 
+ (not really a workaround, but how to get 'sort' to order in
+ lexigraphical order)
+ 
+ *** WARNING *** The locale specified by the environment affects sort
+ order. Set LC_ALL=C to get the traditional sort order that uses native
+ byte values. See http://www.gnu.org/software/coreutils/faq/coreutils-
+ faq.html#Sort-does-not-sort-in-normal-order_0021

-- 
Output of sort is not lexicographically sorted
https://bugs.launchpad.net/bugs/568213
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to