GNU bug report logs - #15524
Inconsistent case-sensitivity behavior

Previous Next

Package: grep;

Reported by: Mark H Weaver <mhw <at> netris.org>

Date: Fri, 4 Oct 2013 05:41:02 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: bug-grep <at> gnu.org
Subject: Inconsistent case-sensitivity behavior
Date: Fri, 04 Oct 2013 01:39:15 -0400
Can anyone explain what's going on here?  Why does the regexp "^[a-z]*$"
match the line "FOO"?

   Regards,
     Mark

--8<---------------cut here---------------start------------->8---
mhw:~$ (echo foo; echo FOO) | grep '[a-z]'
foo
mhw:~$ (echo foo; echo FOO) | grep '^[a-z][a-z][a-z]$'
foo
mhw:~$ (echo foo; echo FOO) | grep '^[a-z]*$'
foo
FOO
mhw:~$ echo $LANG
en_US.UTF-8
mhw:~$ grep --version
grep (GNU grep) 2.8
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
mhw:~$ export
declare -x COLUMNS="125"
declare -x DISPLAY=":0"
declare -x EDITOR="emacsclient"
declare -x EMACS="t"
declare -x HOME="/home/mhw"
declare -x HUSHLOGIN="FALSE"
declare -x HZ="100"
declare -x INPUTRC="/etc/inputrc"
declare -x INSIDE_EMACS="24.3.1,comint"
declare -x LANG="en_US.UTF-8"
declare -x LOGNAME="mhw"
declare -x LYNX_CFG="/home/mhw/lynx.cfg"
declare -x MAIL="/var/mail/mhw"
declare -x OLDPWD="/home/mhw/.local/share/guile/site/2.0"
declare -x PATH="/home/mhw/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
declare -x PS1="\\u:\\w\\\$ "
declare -x PWD="/home/mhw"
declare -x RATPOISON="ratpoison"
declare -x SHELL="/bin/bash"
declare -x SHLVL="4"
declare -x TERM="dumb"
declare -x TERMCAP=""
declare -x USER="mhw"
declare -x WINDOWPATH="7"
declare -x XAUTHORITY="/home/mhw/.Xauthority"
--8<---------------cut here---------------end--------------->8---

I'm using eglibc-2.13.  This is on a system I built myself based on
CLFS, but others have reported seeing the same behavior on Ubuntu.




This bug report was last modified 11 years and 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.