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
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
Confirmed.
Thanks for reporting this. Fixed in CVS. I will make an updated FC4 package to fix this.
Please try out this updated package: https://www.redhat.com/archives/fedora-test-list/2005-June/msg01097.html
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
Thanks for testing. Please try out this updated package: https://www.redhat.com/archives/fedora-test-list/2005-June/msg01106.html
That version works correctly (at least in all my tests thus far). Thanks.
https://www.redhat.com/archives/fedora-announce-list/2005-July/msg00018.html