[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]*
Re: bash 2.05b.0(1)-release on Debian Sarge: [A-Z]* expands as [A-Za-z]* :-(
Mon, 28 Jan 2008 16:57:22 -0700
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
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.