tag 440813 moreinfo
thanks

On Tue, Sep 04, 2007 at 04:15:05PM +0300, Petteri Pajunen wrote:
> Package: grep
> Version: 2.5.1.ds2-6
> 
> On my amd64 debian box using locale
> fi_FI.UTF-8 (all LC_XXX variables set to fi_FI.UTF-8 as well as LANG) grep
> fails to handle character ranges correctly. For example, the first grep is
> wrong but the second works correctly:
> $ echo "w" | grep "[a-z]"
> $ echo "a" | grep "[a-z]"
> a
Are you sure this is not the normal problem of character ranges not
being portable except within the C locale?  The common example is that
[a-z] might actually mean aAbBcCdDeE...z, which is often not what's
expected, since it both includes capital letters and misses "Z".  I
don't know what fi locale looks like..

The typical solution is to either use [[:alpha:]] or just use:
 |LC_ALL=C grep '...'

Justin


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to