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

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

Re: echo a | grep "[A-Z]"


From: Paul Eggert
Subject: Re: echo a | grep "[A-Z]"
Date: Mon, 3 Dec 2001 11:18:39 -0800 (PST)

> From: Hans-Bernhard Broeker <address@hidden>
> Date: 3 Dec 2001 18:21:52 GMT
> 
> > LC_COLLATE=no
> 
> That, and the (IMHO rather boneheaded) requirement in some Unix
> standards that grep should use the locale's collation sequence to
> implement character ranges, instead of what they used to for ages on
> end: rely on ASCII order.

If it's any consolation, that boneheaded requirement has been relaxed
in the latest POSIX draft.  So the next POSIX standard (due any month
now) will allow grep to use ASCII order to interpret range expressions
if it wants to, even in the "no" locale.  However, fix this came at a
price: the behavior of range expressions like [A-Z] is now
implementation-defined outside the POSIX locale.  (Don't you just love
committees?  :-)

> For your own mental sanity, it'll be better to reset LC_COLLATE to "C"
> unless you're sure you really want this particular behaviour.

This will still be true in the next POSIX standard, if you want to be
portable to arbitrary "grep" implementations.



reply via email to

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