This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

grep problem?


I'm getting weird behavior from grep. Searching for a bracketed range of characters (i.e. [A-Z]) is doing case-insensitive matching, while an identical but explicit character set match (i.e. [ABCDE...Z]) does not.  Examples below.  Output of "cygcheck -s -v -r"  attached.

LANG=en_US
GREP_OPTIONS is unset

$ cat > test.dat
abcde
ABCDE

$ grep '[A-Z]' test.dat
abcde
ABCDE

$ grep '[A-E]' test.dat
abcde
ABCDE

$ grep '[a-z]' test.dat
abcde
ABCDE

$ grep '[a-e]' test.dat
abcde
ABCDE

$ grep '[a-b]' test.dat
abcde
ABCDE

Contrast with the correctly-working examples below

$ grep '[ab]' test.dat
abcde

$ grep 'A' test.dat
ABCDE

$ grep a test.dat
abcde

$ grep '[A]' test.dat
ABCDE

$ grep '[ABC]' test.dat
ABCDE

$ grep '[ABCDE]' test.dat
ABCDE

$ grep '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]' test.dat
ABCDE


Attachment: cygcheck.out
Description: cygcheck.out

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]