Bug 122022 - grep end-of line anchor with alpha range fails
grep end-of line anchor with alpha range fails
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: grep (Show other bugs)
3.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-29 15:52 EDT by Eric Klimas
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-04-30 09:12:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eric Klimas 2004-04-29 15:52:04 EDT
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 09:12:48 EDT
[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.