Bug 161700 - grep -Fw fails to match anything
Summary: grep -Fw fails to match anything
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: grep
Version: 4
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-26 01:21 UTC by Jordan Russell
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-07-25 09:58:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Jordan Russell 2005-06-26 01:21:57 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4

Description of problem:
When I pass both the -F and -w options to grep, it never prints any matches and always returns 1.

This is a regression from previous releases of grep. The most recent grep package on RHEL3 (grep-2.5.1-24.4) does not exhibit this problem.

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

How reproducible:
Always

Steps to Reproduce:
Issue the following commands on Fedora Core 4:

# echo test > testfile
# grep -Fw test testfile
# echo $?
1

Actual Results:  Clearly testfile contains the word "test", but grep thinks it doesn't -- it outputs nothing and returns 1.

Expected Results:  The same commands on Red Hat Enterprise Linux 3 produce the correct results:

# echo test > testfile
# grep -Fw test testfile
test
# echo $?
0

Additional info:

In case it matters, my systems use LANG=en_US

Comment 1 Jordan Russell 2005-06-26 17:55:00 UTC
The bug appears to be dependent on the LANG setting.

On Fedora Core 4:

# LANG=en_US grep -Fw test testfile
# LANG=en_US.utf8 grep -Fw test testfile
test

On Red Hat Enterprise Linux 3 (grep-2.5.1-24.4):

# LANG=en_US grep -Fw test testfile
test
# LANG=en_US.utf8 grep -Fw test testfile
test

Comment 2 Tim Waugh 2005-06-27 08:17:31 UTC
Confirmed.

Comment 4 Tim Waugh 2005-06-27 11:33:03 UTC
Thanks for reporting this.  Fixed in CVS.

I will make an updated FC4 package to fix this.

Comment 5 Tim Waugh 2005-06-28 14:31:15 UTC
Please try out this updated package:

https://www.redhat.com/archives/fedora-test-list/2005-June/msg01097.html

Comment 6 Jordan Russell 2005-06-28 16:47:08 UTC
The new package fixes the original case, but it doesn't seem to help when the
word is present in the middle of a line:

# echo 'x test x' > testfile
# LANG=en_US grep -Fw test testfile
# LANG=en_US.utf8 grep -Fw test testfile
x test x

Comment 7 Tim Waugh 2005-06-28 22:41:20 UTC
Thanks for testing.  Please try out this updated package:

https://www.redhat.com/archives/fedora-test-list/2005-June/msg01106.html


Comment 9 Jordan Russell 2005-06-29 03:21:42 UTC
That version works correctly (at least in all my tests thus far).

Thanks.


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