Bug 24924

Summary: grep does not match [^]] OK due to RedHat patch
Product: [Retired] Red Hat Linux Reporter: Remco Wouts <remco>
Component: grepAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: high Docs Contact:
Priority: high    
Version: 7.1CC: reg.bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-09 15:08:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Remco Wouts 2001-01-25 12:29:50 UTC
The following does work correctly in GNU grep 2.4.2:
$ echo -e "]name\n name" | grep '[^]]name'
It matches ' name' and does not match ']name' as it should.

However the RedHat patched version of GNU grep 2.4.2 matches /both/ ']name' 
and ' name'. This is not good especially since this construct is used a lot
in scripts 
like so:
$ ps ax | grep '[^]]progname'
To filter out all instances of progname except the grep invocation.

Comment 1 Karsten Hopp 2001-02-09 15:08:00 UTC
still doesn't work

Comment 2 Bernhard Rosenkraenzer 2001-05-13 14:21:38 UTC
Fixed in 2.5e-2


Comment 3 Vlado Potisk 2001-08-24 19:49:50 UTC
Upgraded to 2.5e-2 to fix this one but it introduces a new bug
in grep causing ./configure scripts (autoconf) to give wrong
results ! Here is the proof: this line shows no match,
and that's incorrect
  echo "mode_t;" | grep "mode_t[^a-zA-Z_0-9]"
 
I checked Rawhide today and the 2.5-e2 version is no longer there,
there is 2.4.2-7 instead which appears not to have any of these bugs.