[OpenIndiana-discuss] OI and GNU grep
Guido Berhoerster
gber at openindiana.org
Tue Oct 11 17:55:02 UTC 2011
* Richard Jones <openindiana-discuss at jonze.com> [2011-10-11 18:42]:
> I'm probably being really thick, but what's going on here?
>
> set | grep -i grep
> $ which grep
> /usr/gnu/bin/grep
> $ echo foo | grep '[A-Z]'
> foo
>
> I get the expected behaviour on linux boxes with GNU grep.
That this works in any locale in Linux a GNUism, you cannot rely
on the portability of such a contruct in anything but the POSIX
locale (see also
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_05)
because ranges inside bracket expressions depend on the order of
characters in a locale. If you want it to work the way you
expected it to work set LC_ALL=C or LC_COLLATE=C.
--
Guido Berhoerster
More information about the OpenIndiana-discuss
mailing list