Bug 122022 - grep end-of line anchor with alpha range fails
Summary: grep end-of line anchor with alpha range fails
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: grep
Version: 3.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-04-29 19:52 UTC by Eric Klimas
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-04-30 13:12:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Eric Klimas 2004-04-29 19:52:04 UTC
Description of problem:
grep doesn't seem to be case sensitive on a range pattern anchored to
the end of the line (i.e. '[A-Z]$' or '[a-z]]$').

Version-Release number of selected component (if applicable):
grep-2.5.1-16


How reproducible: Always


Steps to Reproduce:
1. Create a file (t.txt) that has the following in lines in it:
This is
a
Test of GREP
to seE
if its
working
12345
Another linE


2. run the command:
grep '[A-Z]$' t.txt

3. run the command:
grep '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]$' t.txt

4. run the command:
grep '[A-P]$' t.txt 

5. run the commnad:
grep '[ABCDEFGHIJKLMNOP]$' t.txt

Actual results:
[rds@rdsone ietmcm]$ grep '[A-Z]$' t.txt                  
This is
Test of GREP
to seE
if its
working
Another linE
[rds@rdsone ietmcm]$ grep '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]$' t.txt
Test of GREP
to seE
Another linE
[rds@rdsone ietmcm]$ grep '[A-P]$' t.txt
Test of GREP
to seE
working
Another linE
[rds@rdsone ietmcm]$ grep '[ABCDEFGHIJKLMNOP]$' t.txt
Test of GREP
to seE
Another linE


Expected results:
[rds@rdsone ietmcm]$ grep '[A-Z]$' t.txt                  
Test of GREP
to seE
Another linE
[rds@rdsone ietmcm]$ grep '[ABCDEFGHIJKLMNOPQRSTUVWXYZ]$' t.txt
Test of GREP
to seE
Another linE
[rds@rdsone ietmcm]$ grep '[A-P]$' t.txt
Test of GREP
to seE
Another linE
[rds@rdsone ietmcm]$ grep '[ABCDEFGHIJKLMNOP]$' t.txt
Test of GREP
to seE
Another linE


Additional info: none

Comment 1 Tim Waugh 2004-04-30 13:12:48 UTC
[A-Z] is not generally a case-sensitive range, and neither is [a-z] --
except for the specific case of the C locale.

Perhaps you mean to use '[[:upper:]]' and '[[:lower:]]'?


Note You need to log in before you can comment on or make changes to this bug.