bug-grep
[Top][All Lists]
Advanced

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

Re: grep '[^a-z]oo' oo.txt


From: Paolo Bonzini
Subject: Re: grep '[^a-z]oo' oo.txt
Date: Mon, 28 Feb 2011 09:27:51 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 02/27/2011 02:17 PM, yuanbx wrote:
My grep is grep 2.6.3, ubuntu 10.10


oo.txt such as


"Open Source" is a good mechanism to develop programs.
apple is my favorite food.
Football game is not use feet only.
The soup taste good.
I cant't finish the test.
google is the best tools for serch keyword.
goooooogle yes!
the symbol '*' is represented as start.
The world is the same with "glad".
However, this dress is about $3183 dollars.
You are the best is mean you are the no. 1.
gog dod fof ioi ror.

address@hidden:~$ grep '[^g-z]oo' oo.txt
apple is my favorite food.
Football game is not use feet only.
address@hidden:~$  grep '[^f-z]oo' oo.txt
address@hidden:~$

See "Environment Variables" in the grep manual:

`LC_ALL'
`LC_COLLATE'
`LANG'
     These variables specify the locale for the `LC_COLLATE' category,
     which determines the collating sequence used to interpret range
     expressions like `[a-z]'.

`LC_ALL'
`LC_CTYPE'
`LANG'
     These variables specify the locale for the `LC_CTYPE' category,
     which determines the type of characters, e.g., which characters
     are whitespace.

Your use case would be "fixed" (but it's not a bug, really) by "export LC_ALL=C".
Paolo



reply via email to

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