[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fri, 25 Feb 2005 21:25:55 -0700
Stepan Kasal wrote:
> jfp wrote:
> > $ echo "A" | grep '[a-z]'
> > A
> > $ echo "a" | grep '[A-Z]'
> > $ echo "b" | grep '[A-Z]'
> > b
> > $
> Unfortunately, this is not a bug, but a (weird) feature of modern locales.
Agreed. For those of us that are used to standard sorting these new
locales do seem strange.
I recommend that if you are looking for upper and lower case letters
that you investigate using the named character classes. This avoids
much of the problems.
echo "A" | grep '[[:upper:]]'
echo "A" | grep '[[:lower:]]'
And so forth. You can find this documentation in both the info and