[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep -i '[A-Z]' finds only lower case
From: |
Matthias . Muth |
Subject: |
grep -i '[A-Z]' finds only lower case |
Date: |
Tue, 23 Feb 2010 13:50:15 +0100 |
Hi,
I have entered this bug description into the grep bug list at savannah.gnu.org:
--------------------------------------------------------------------------------
I have installed grep 2.5.4-2 as a part of a recent upgrade of my Cygwin
environment.
I now have problems with some scripts that use 'grep -i' with a character class
pattern.
It seems that the -i switch switches character class patterns to lower case
instead of ignoring case.
REPEAT BY:
(Using grep 2.5.4-2 on Cygwin.)
[Addition: grep 2.5.4-1 has the same problem.]
# Create a test data file containing one upper case and one lower case data
line:
echo "abc" > data
echo "ABC" >> data
# A fixed uppercase pattern
# should return the upper case line only:
echo "Test 1: expect ABC"
grep 'ABC' data
# Using a pattern with a character class containing
# upper case letters should return the same result:
echo "Test 2: expect ABC"
grep 'A[B]C' data
# Adding a '-i' to the first test run (fixed pattern)
# should return both upper case and lower case lines:
echo "Test 2: expect abc ABC"
grep -i 'ABC' data
# Adding a '-i' to the second test run (character class pattern)
# should also return both upper case and lower case lines:
echo "expect abc ABC"
grep -i 'A[B]C' data
Does this only not work for me or can anyone reproduce this problem?
Thanks for your support!
Best regards,
Matthias
- grep -i '[A-Z]' finds only lower case,
Matthias . Muth <=