* On Wednesday 2005-11-16 at 16:39:36 -0800, Geoff Kuenning wrote: > > The root user is probably using a different locale. > > Bingo. That was (is) the problem. Thanks. > > But I don't understand why the locale should matter when I'm only > grepping for 7-bit characters.
Because neither grep nor the regex/C library know in advance that you are, unless you declare it through the locale mechanism. Both pattern and file data matter, and file data is (are?) discovered as it is processed. (I.e., there is only one pass.) Different code paths are taken in various places, according to the locale, or more precisely, whether the current maximum octet length for characters under it is 1 or something greater than 1. One specific code path may have bugs that are unique to it.
