When using grep under LANG=en_GB.UTF8 it searches insensitive to case. $ export LANG=en_GB.UTF-8 $ echo ABC | grep [a-z] ABC $ echo abc | grep [A-Z] abc If I unset the LANG, then it returns to 'normal' behaviour. $ unset LANG $ echo ABC | grep [a-z] $ echo abc | grep [A-Z] Needless to say this is very counter intuitive. It seems sed is also affected see bug 208051. Reading in the "man grep" it says: "Many locales sort characters in dictionary 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." So OK, obviously the UTF8 locale is one of these cases. But do we truly want grep to behave in this manner by default? Surely it is more sensible to have it behave under the default collating method. I put this as a request to have LC_COLLATE="C" put into the profile to remove this odd default. PS: I see that comment #4 on bug 208051 suggests that reading the documentation is enough, and I agree it does describe the issue but the question is what do we want as a default. Thanks!
[A-Z][a-z] is locale-specific; you need [[:upper:]] or [[:lower:]] or whatnot, and please stop filing support requests in bugzilla.
I don't actually see anywhere that I am asking for "support" with grep? Instead I see a question regarding the default behaviour of grep and whether or not someone might want to alter the profile to stop this confusing behaviour. I can assure you that I would file my support requests in a forum where they can be discussed, not in bugzilla. This is not a bug with grep, this is a bug with the default environment of gentoo.
No, there's no bug with default environment of gentoo. Locales are *completely* something for user to configure.