"Daben Liu" <[EMAIL PROTECTED]> writes:
| I'm using the sort program on RedHat 6.1, Linux 2.2.12-20smp distribution.
| The sort program behaves weird.
|
| The problem is illustrated as below:
| > uname -a
| Linux piper 2.2.12-20smp #1 SMP Mon Sep 27 10:34:45 EDT 1999 i686 unknown
| > which sort
| /bin/sort
| > cat doo
| AC
| +C
| > sort doo
| AC
| +C
| > cat foo
| A
| +
| > sort foo
| +
| A
|
| It seems like the "sort doo" isn't doing what it's supposed to
| do.
[The above is a frequently asked question. Here's the answer. ]
You are using the version of sort that comes with textutils-2.0
or newer and have reported a problem whereby it is sorting in
some non-ASCII order.
That is due not to a bug in sort, but to the fact that you have
set environment variables that direct sort to use improper locale-
specific tables (you probably have LC_ALL set to en_US).
You should 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 then sort will work the way you expect.