Thanks Jan for the report. I confirm that this bug applies to the cvs version of grep. The example reported, however, behaves differently on my environment.
On "Linux 2.6.14.6-grsec #3 SMP Mon Jan 16 13:46:37 AST 2006 x86_64 GNU/Linux", using CVS grep as of March 5, 2006, I observe the following grep '[a-z]' matches letters 'B' to 'Z' (not 'A') and letters 'a' to 'z'. grep '[A-Z]' matches letters 'a' to 'y' (not 'z') and letters 'A' to 'Z'. Easy tests using colours: echo '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | grep --color '[a-z]' and echo '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' | grep --color '[A-Z]' Cheers, TAA ----------------------------------------------------- Tony Abou-Assaleh Lecturer, Computer Science Department Brock University, St. Catharines, ON, Canada, L2S 3A1 Office: MC J215 Tel: +1(905)688-5550 ext. 5243 Fax: +1(905)688-3255 Email: [EMAIL PROTECTED] WWW: http://www.cosc.brocku.ca/~taa/ ----------------------[THE END]---------------------- On Mon, 27 Feb 2006, Jan Wielemaker wrote: > Hi, > > I came accross a bug in grep as distributed with SuSE 10.0: > > % grep --version > grep (GNU grep) 2.5.1 > > Please try: > > % grep '[A-Z]' > a > ab > ab # echoed: match!? > > There are quite some variations possible. Somehow the [A-Z] pattern appears > to match on two different lowercase letters. > > Regards --- Jan > > P.s. SuSE 10.0 is bundled with gcc version 4.0.2. Guess that is the > compiler they used to build the binaries. I'm running the x86 > version on an AMD Athlon system. > > >
