bug-grep
[Top][All Lists]
Advanced

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

Re: Bug#577095: grep: bracket expressions fails depending on the locale


From: Aníbal Monsalve Salazar
Subject: Re: Bug#577095: grep: bracket expressions fails depending on the locale
Date: Sat, 10 Apr 2010 13:56:52 +1000
User-agent: Mutt/1.5.20 (2009-06-14)

On Fri, Apr 09, 2010 at 04:35:35PM +0200, Bernd Zeimetz wrote:
>Package: grep
>Version: 2.6.3-1
>Severity: grave
>
>As this issue might affact a lot of cases where grep is used, I've
>decided to file it with the severity grave.
>
>Since version 2.6.3 (and it seems also 2.5.2 was affected), the
>behaviour of grep regarding capital letters in bracket expressions
>changed when using UTF8:
>
>With grep 2.6.3:
>address@hidden ~% LANG=en_US.UTF-8 grep -E '^[A-Z]' /etc/passwd | wc -l        
>51
>address@hidden ~% LANG=C grep -E '^[A-Z]' /etc/passwd        
>Debian-exim:x:100:103::/var/spool/exim4:/bin/false
>address@hidden ~% LANG=de_DE.iso8859-15 grep -E '^[A-Z]' /etc/passwd 
>Debian-exim:x:100:103::/var/spool/exim4:/bin/false
>
>With grep 2.5.4-4:
>address@hidden ~% LANG=en_US.UTF-8 grep -E '^[A-Z]' /etc/passwd        
>Debian-exim:x:100:103::/var/spool/exim4:/bin/false
>address@hidden ~% LANG=C grep -E '^[A-Z]' /etc/passwd          
>Debian-exim:x:100:103::/var/spool/exim4:/bin/false
>address@hidden ~% LANG=de_DE.iso8859-15 grep -E '^[A-Z]' /etc/passwd   
>Debian-exim:x:100:103::/var/spool/exim4:/bin/false
>
>This behaviour change is not expected and different from what other
>implementations do.
>
>-- System Information:
>Debian Release: squeeze/sid
>  APT prefers unstable
>  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
>Architecture: amd64 (x86_64)
>
>Kernel: Linux 2.6.33-think (SMP w/2 CPU cores; PREEMPT)
>Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
>Shell: /bin/sh linked to /bin/bash
>
>Versions of packages grep depends on:
>ii  dpkg                      1.15.5.6       Debian package management system
>ii  install-info              4.13a.dfsg.1-5 Manage installed documentation in 
>ii  libc6                     2.10.2-6       Embedded GNU C Library: Shared lib
>
>grep recommends no packages.
>
>Versions of packages grep suggests:
>ii  libpcre3                      7.8-3      Perl 5 Compatible Regular Expressi
>
>-- no debconf information

I reproduced this bug, see below.

grep --version
GNU grep 2.6.3

cat /tmp/a
root:x:0:0:root:/root:/bin/bash
anibal:x:1000:1000:Anibal Monsalve Salazar,,,:/home/anibal:/bin/bash
Debian-exim:x:102:104::/var/spool/exim4:/bin/false
ntp:x:106:108::/home/ntp:/bin/false

grep -E '^[A-Z]' /tmp/a
root:x:0:0:root:/root:/bin/bash
Debian-exim:x:102:104::/var/spool/exim4:/bin/false
ntp:x:106:108::/home/ntp:/bin/false

grep -Ev '^[A-Z]' /tmp/a
anibal:x:1000:1000:Anibal Monsalve Salazar,,,:/home/anibal:/bin/bash




reply via email to

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