bug-textutils
[Top][All Lists]
Advanced

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

Re: sort error in sort


From: Bob Proulx
Subject: Re: sort error in sort
Date: Sat, 24 Feb 2001 12:22:21 -0700

> sort version 2.0.11, kernel 2.4.0, glibc 2.2 (RedHat 7 plus updates).
> 
> sample input:
> 
> kernel-2.a
> kernel-2.b
> kernel-ent
> kernelcfg
> 
> pass through filter "sort -f"
> 
> result:
> 
> kernel-2.a
> kernel-2.b
> kernelcfg
> kernel-ent
> 
> A rather novel lexigraphical order!

Jim has previously answered these reports with the following message.
Note that some vendors set those language variables for you without
you being aware of them.

Bob


Jim Meyering writes:

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 or your vendor have probably set environment
variables like LANG, LC_ALL, or LANGUAGE to en_US).

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 sort will then work the way you expect.
-----------

BTW, in recent textutils test releases, sort --help output
includes this:

  *** WARNING ***
  This version of sort honors the locale settings in your environment.
  For example, if you set one of the LANG or LC_ALL environment variables
  to `en_US', then sort will work very differently than most people expect.
  If that's not what you want, then set LC_ALL to POSIX in your environment.



reply via email to

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