bug-bash
[Top][All Lists]
Advanced

[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: Bob Proulx
Subject: Re: bash 2.05b.0(1)-release on Debian Sarge: [A-Z]* expands as [A-Za-z]* :-(
Date: Mon, 28 Jan 2008 16:57:22 -0700
User-agent: Mutt/1.5.13 (2006-08-11)

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.

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.

Bob




reply via email to

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