Bug 590002 - grep changed behavior for interval patterns
Summary: grep changed behavior for interval patterns
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: grep   
(Show other bugs)
Version: 6.0
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jaroslav Škarvada
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: 594571 596249
TreeView+ depends on / blocked
 
Reported: 2010-05-07 13:39 UTC by Ondrej Hudlicky
Modified: 2010-06-17 09:17 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 594571 596249 (view as bug list)
Environment:
Last Closed: 2010-06-17 09:17:30 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Ondrej Hudlicky 2010-05-07 13:39:23 UTC
Description of problem:

$ echo $LANG
en_US.UTF-8
$ echo -e "HELLO\nworld" | grep '[a-z]'
HELLO
world
$ LC_COLLATE=C echo -e "HELLO\nworld" | grep '[a-z]'
world

Character intervals are dependent on collates (LC_COLLATE). Default - locale UTF based collate - is excellent for sorts but not so friendly to interval searches: aAbBcC...yYzZ.
Old grep behaviour was wrong, on the other hand new POSIX based behaviour can bring troubles - break old scripts. More customers and also internal tools could be affected.

Recommended solution: 
Document in RHEL6 release notes
1. to preserve old behavior: export LC_COLLATE=C
2. correct way to grep lower/upper case is to use patterns [:lower:],[:upper:]..

Version-Release number of selected component (if applicable):
grep-2.6+

How reproducible:
always 

Additional info:
Fedora thread
http://post-office.corp.redhat.com/archives/tech-list/2010-April/msg00480.html
Related bugs: 
https://bugzilla.redhat.com/show_bug.cgi?id=576594

Comment 1 RHEL Product and Program Management 2010-05-07 14:07:50 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 3 Radek Vokal 2010-06-17 09:00:20 UTC
There's no code change needed, all we need is proper documentation. The bug for Migration guide is bug #594571 .

Comment 4 RHEL Product and Program Management 2010-06-17 09:17:30 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.


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