Bug 159532

Summary: grep -w not exact matching and adding extra line
Product: Red Hat Enterprise Linux 3 Reporter: Phil Battaglia <battman21>
Component: grepAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2005-565 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-09-28 18:47:30 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:
Bug Depends On:    
Bug Blocks: 156320    

Description Phil Battaglia 2005-06-03 16:43:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; Q312461; .NET CLR 1.1.4322)

Description of problem:
Using grep-2.5.1-24.4.i386.rpm, the "-w" option seems to fail consistently, by ignoring the "-o" option and adds an extra newline.  My usage includes the "-f" option to use for pattern matching.

grep-2.5.1-24.1.i386.rpm is successful.

Version-Release number of selected component (if applicable):
grep-2.5.1-24.4.i386.rpm

How reproducible:
Always

Steps to Reproduce:
1. Create the pattern file.
2. Use egrep with the "-o" and "-w" options, as well as "-f <pattern file>".
3. Failure.
  

Actual Results:  *** Contents of pat_grep ***
[root@dev bin]# cat pat_grep
65\.96\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}
***********************

*** Using grep-2.5.1-24.4.i386.rpm ***
[root@dev bin]# echo "65.96.147.166 test" | egrep -m1 -wof pat_grep
65.96.147.166 test

***********************


Expected Results:  *** Using grep-2.5.1-24.1.i386.rpm ***
[root@dev bin]# echo "65.96.147.166 test" | egrep -m1 -wof pat_grep
65.96.147.166
***********************

Additional info:

Comment 2 Tim Waugh 2005-06-07 15:24:40 UTC
Confirmed.  Red Hat Enterprise Linux 4 is not affected.

This is a regression since Red Hat Enterprise Linux 3 release.

Comment 10 Red Hat Bugzilla 2005-09-28 18:47:30 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-565.html