Bug 161700 - grep -Fw fails to match anything
grep -Fw fails to match anything
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: grep (Show other bugs)
4
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Tim Waugh
Mike McLean
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-25 21:21 EDT by Jordan Russell
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-07-25 05:58:01 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 Jordan Russell 2005-06-25 21:21:57 EDT
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 13:55:00 EDT
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 04:17:31 EDT
Confirmed.
Comment 4 Tim Waugh 2005-06-27 07:33:03 EDT
Thanks for reporting this.  Fixed in CVS.

I will make an updated FC4 package to fix this.
Comment 5 Tim Waugh 2005-06-28 10:31:15 EDT
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 12:47:08 EDT
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 18:41:20 EDT
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-28 23:21:42 EDT
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.