[Top][All Lists]

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

Re: grep

From: Stepan Kasal
Subject: Re: grep
Date: Fri, 25 Feb 2005 21:34:17 +0100
User-agent: Mutt/1.4.1i

  thank you for taking care to send the bug report.

On Fri, Feb 25, 2005 at 05:11:43PM -0500, 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.

Have you tried 'z' and 'Z'?

The problem is in locale settings, try "man locale".

The default for recent redhat systems seems to be "en_US.utf8".
If you set LC_ALL=C, the problem will disappear.

The utf8 encoding has this order of letters:

a A b B ... z Z

That's why A-Z contains 'b', but not 'a'.

Have a nice day,

reply via email to

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