bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: grep


From: Stepan Kasal
Subject: Re: grep
Date: Tue, 13 Apr 2004 15:55:13 +0200
User-agent: Mutt/1.4.1i

Hello,

On Tue, Apr 13, 2004 at 04:43:23PM +0200, Ishai Ram wrote:
> Red Hat Linux release 9 (Shrike)
> Kernel 2.4.20-8 on an i686
> 
> the command is:
> grep '^[A-Z]' filename
> or
> grep '^[A-Z]' #stdin
> 
> expected result:
> grep only lines beggining with Uppercase.
> the result I get:
> grep any line that beginns with any letter (ignoring case sencetivity).
> 
> There were no aliases and -i option was not used.

The problem is probably caused by locales. Observe:

$ echo a |LC_ALL=en_GB.UTF8 grep '^[A-Z]'             
$ echo z |LC_ALL=en_GB.UTF8 grep '^[A-Z]'
z
$ echo z |LC_ALL=en_GB grep '^[A-Z]'
$

This means that the en_GB.UTF8 locale has different collating sequence then
en_GB .
I'm not sure whether it's a bug, I'll investigate later.

In any case, setting LC_ALL=C should help.

It's a good idea to start all scripts you write by
        LC_ALL=C;export LC_ALL

Hope this helps,
        Stepan Kasal




reply via email to

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