[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep
From: |
Bob Proulx |
Subject: |
Re: grep |
Date: |
Fri, 25 Feb 2005 21:25:55 -0700 |
User-agent: |
Mutt/1.5.6+20040907i |
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:]]'
A
echo "A" | grep '[[:lower:]]'
And so forth. You can find this documentation in both the info and
man pages.
Bob