[PLUG] bash surprise
Bill Spears
bspears at easystreet.com
Fri Feb 13 11:42:12 UTC 2004
On Fri, 2004-02-13 at 11:10, Zot O'Connor wrote:
> On Fri, 2004-02-13 at 10:47, Bill Spears wrote:
> > Try this:
> > $ echo B | grep [a-z]
> >
> > Cure seems to be LC_ALL=C.
> >
>
> This is a grep issue:
>
> man grep:
>
> Within a bracket expression, a range expression consists of two charac-
> ters separated by a hyphen. It matches any single character that sorts
> between the two characters, inclusive, using the localeâs collating
> sequence and character set. For example, in the default C locale,
> [a-d] is equivalent to [abcd].
> >>>>>>>>
> Many locales sort characters in dictio-
> nary order, and in these locales [a-d] is typically not equivalent to
> [abcd]; it might be equivalent to [aBbCcDd], for example. To obtain
> the traditional interpretation of bracket expressions, you can use the
> C locale by setting the LC_ALL environment variable to the value C.
My thoughts exactly. I just thought it should have been set.
BTW, LC_ALL=C goes in /etc/profile right?
Bill Spears <bspears at easystreet.com>
More information about the PLUG
mailing list