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

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

Re: egrep bug


From: Eric Blake
Subject: Re: egrep bug
Date: Sun, 04 Jan 2009 10:27:36 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bob Greiner on 1/4/2009 7:30 AM:
>    egrep "^[A-Z]" data.txt
>    
> does not return just those records beginning with upper case letters.

This is due to your locale (in particular, LC_COLLATE).  The following
link, while not directly about grep, contains relevant information:
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-not-sort-in-normal-order_0021

> Is this change to version 2.4.2 an oversight or a deliberate modification?

Deliberate, due to POSIX requirements and your current locale, but you can
work around it by specifying a different locale:

LC_ALL=C egrep "^[a-z]" data.txt

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklg8YgACgkQ84KuGfSFAYB5fACgj6pJptVI9cd58AQmPWmVrwVp
WdwAoJJJyfUfSnogiPswFuKJ2Y7xX0rr
=V5e6
-----END PGP SIGNATURE-----




reply via email to

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