[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: sort order changed in "sort" and "ls".
From: |
Rogier Wolff |
Subject: |
Re: sort order changed in "sort" and "ls". |
Date: |
Fri, 13 Mar 2009 09:21:42 +0100 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
Guys, I've been using Unix systems for over twenty years. I see that
other people manage to get their Unix systems to "talk" to them in
Dutch: "Bestand is niet gevonden". Besides that this sentence is wrong
in a lot of contexts, I'm used to "file not found".
When I install a modern system, (possibly through debootstrap, a
chrooted or nfs-mounted root setup), perl complains loudly about some
LC_ variable not being set. The way I've found to get it to shut up,
and get a sane, working apt-setup is to install "locales" whatever
that may mean. I then have to select somthing that starts with "en" to
get the system to speak english to me.
Apparently one of these steps has the side effect of changing the sort
order. I just want the system to talk english to me, and simply sort
my directories in the "normal" order. I don't even know where the LANG
variable is set. I don't want to have to find out. It is not mentioned
in your FAQ.
Your explanation is fine. But it should be in the FAQ. The FAQ tells
me that if it sorts weird, I have an LC_... variable set. I didn't
have an LC_... variable set, and still it sorted wrong. I'm smart
enough to finally figure out it was a LANG variable, and you're
intimate enough with the workings of all this to explain the order
in which the different setting variables are tried. However, as it
stands I had no chance to find accurate information in the FAQ.
I own some 15 systems, different base operating systems, different
people who set them up initially. I'm not THAT annoyed by the sorting
order that I'm going to find and fix all those systems to sort exactly
as I'm used to. Apparently it's my fault, and I'll have to live with
it.
Oh well.
Roger.
On Thu, Mar 12, 2009 at 06:38:21PM -0600, Eric Blake wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> According to Rogier Wolff on 3/10/2009 9:15 AM:
> > On Tue, Mar 10, 2009 at 02:40:32PM +0000, Eric Blake wrote:
> >> Most likely, this is due to your choice of locales, and not a bug
> >> in sort nor in ls.
> >>
> >> http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-not-sort-in-normal-order_0021
> >> http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-ls-command-is-not-listing-files-in-a-normal-order_0021
> >
> > Apparently it's LANG that sets the locale: no LC_* variables were set.
>
> LANG is the default that is used when LC_* are not set, which in turn are
> used only when LC_ALL is not set. And if LANG is not set, then it is
> system-defined what the default is (in other words, with LANG not set, you
> may get lucky and get the C locale on your system, but not on all
> systems). The FAQ recommends LC_ALL because that is the simplest fix, not
> to mention that it avoids problems that may arise from mixing incompatible
> LC categories (such as selecting a unibyte LC_CTYPE but a multibyte
> LC_COLLATE).
>
> - --
> Don't work too hard, make some time for fun as well!
>
> Eric Blake address@hidden
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (Cygwin)
> Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkm5qv0ACgkQ84KuGfSFAYBn2gCfc6suyOlI1fDwWmfYKj/NOKf6
> yJAAoIw0Xw8HHUcBSRQlLJ7V9pI9+5hf
> =nhLF
> -----END PGP SIGNATURE-----
>
--
** address@hidden ** http://www.BitWizard.nl/ ** +31-15-2600998 **
** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
Q: It doesn't work. A: Look buddy, doesn't work is an ambiguous statement.
Does it sit on the couch all day? Is it unemployed? Please be specific!
Define 'it' and what it isn't doing. --------- Adapted from lxrbot FAQ
Re: sort order changed in "sort" and "ls"., Pádraig Brady, 2009/03/10