Thank you for your bug report.

Actually, the behaviour you are seeing is correct, see
http://www.gnu.org/software/grep/manual/grep.html#Character-Classes-and-
Bracket-Expressions

[a-z] does match 'F' because it is sorted between a and z -- at least in most 
locales. You have to explicitly use the C locale to get the result you expect:
echo FOO | LC_ALL=C grep '^[a-z]' ; echo $?

Since you are the second one mentioning (see bug 799181) that a newer
version of grep does not show this behaviour, I searched for changes in
grep and found the sentence "grep's interpretation of range expression
is now more consistent with that of other tools." in the NEWS file. It
refers to this commit
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=99d3c7e1308beb1ce9a3c535ca4b6581ebd653ee

Either way, when you compiled grep, you probably did not use "--without-
included-regex" as the Ubuntu build does, right?

** Changed in: grep (Ubuntu)
       Status: New => Incomplete

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/759849

Title:
  echo FOO | grep '^[a-z]' returns 0

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grep/+bug/759849/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to