Bug 43564
Summary: | /bin/sort is sorting by case-folded alphabetic order! | ||
---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Dan Reish <dreish> |
Component: | textutils | Assignee: | Bernhard Rosenkraenzer <bero> |
Status: | CLOSED NOTABUG | QA Contact: | David Lawrence <dkl> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 7.1 | CC: | stano |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2001-06-26 14:49:09 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Dan Reish
2001-06-05 15:40:44 UTC
Okay, so this is caused by LC_ALL not being set to POSIX in .bashrc, but that's still a severe bug. Read through http://mail.gnu.org/pipermail/bug-textutils/ to see the bullshit that various GNU volunteers have had to deal with because of this bug (going back to at least October 1999). I'm sure it's just an honest mistake, but it's hard not to get angry at Red Hat about something like this, especially given that the bug has existed for such a long time. There is no point in getting angry. This is not a mistake or bug, the sort works like advertised - see the (texinfo) docs: Unless otherwise specified, all comparisons use the character collating sequence specified by the `LC_COLLATE' locale. The way the sorting works is defined by locale. Being the author of the slovak locale in glibc (with the collating part copied from the czech one) I know these issues quite well. We use one of the fancier locales and our sorting standard is actually unimplementable (it even requires the knowledge of the history :-)). Sort is _text_ sorting utility and it should sort exactly how the locale prescribes. Shell scripts that are screwing data because of this are broken and the collating order is the lesser problem - e.g. not resetting LC_NUMERIC or grepping for some strings in output can be even worse. There are many hidden gotchas like this - e.g. [A-Z]* will match foo in some locales. If you don't like it, echo "LC_COLLATE=C" >>/etc/sysconfig/i18n |