[Top][All Lists]

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

Re: bash 2.05b.0(1)-release on Debian Sarge: [A-Z]* expands as [A-Za-z]*

From: Alan Mackenzie
Subject: Re: bash 2.05b.0(1)-release on Debian Sarge: [A-Z]* expands as [A-Za-z]* :-(
Date: Wed, 30 Jan 2008 20:52:32 +0000
User-agent: Mutt/1.5.9i

Hi, Bob and Eric,

Thanks muchly for the help!

On Mon, Jan 28, 2008 at 04:57:22PM -0700, Bob Proulx wrote:
> Eric Blake wrote:
> > According Alan Mackenzie:
> > | % ls [A-Z]*
> > | .  Sadly, ls ignores my intentions and undiscerningly prints a list of
> > | all files whose names begin with a letter, big or small.

> > Actually, it follows your (unintended) directions, thanks to your
> > current locale, which does a collation sort.  You aren't doing
> > [A-Za-z], but [AaBb...Z], because your current locale prefers
> > case-insensitive collation.  Change your locale (try LC_COLLATE=C or
> > LC_ALL=C) to see the difference.

Yes, this works!

Ah.  I've got $LANG set to en_GB.  Who did this?  How dare they!  OK, I
did this myself, somehow, presumably during installation of Debian

Why didn't "they" tell me I was messing up my shell?  Why do I feel so
stupid?  (OK, don't answer that one!)

More to the point, where are these variables (LANG,
LC_{ALL,COLLATE,CTYPE,MESSAGES,NUMERIC} documented?  They're mentioned skimpily
in the bash man page, but where are they fully documented?  What is a
"locale category"?  What set of values can these variables take?  _How_
are they "used"?

> Or in the new expression syntax say that you are looking for upper
> case letters explicitly.
>   ls -d [[:upper:]]*
> That should work regardless of locale setting.

OK.  I'll use that if I really have to, but I'd prefer [A-Z] to work

Again, thanks!

> Bob

reply via email to

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