Red Hat Bugzilla – Bug 97526
bad fgrep matching 2.5
Last modified: 2007-04-18 12:54:52 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120
Description of problem:
Definitely fgrep 2.5.x fails finding matches between two lists of strings. To
see it try "fgrep -wf fileA fileB" where fileA and fileB are two ascii files
with strings to match, one per line, and fileA is a subset of fileB (all the
strings of fileA are contained in fileB). In the general case, fgrep is unable
to match all the entries in fileA to the corresponding strings in fileB, it just
do it for the most of them, but not all, in such a way that when running
"fgrep -wf fileA fileB | wc -l"
you won't obtain the number of real coincidences, but less. If you invert the
order of files
"fgrep -wf fileB fileA | wc -l"
in this case it matches correctly all the common strings, and you obtain as a
result of the above command a number which is equal to the number of lines of
the fileA (as it have to be). Remember fileB is the greater one.
If necessary I could provide with two files prepared for the test.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Explained in detail at the Description
I can realize the fail only happens in version 2.5.x of grep. Not in 2.4.x.
So it affects redhat 7.3 and the following
Please supply a test case.
Created attachment 92441 [details]
Created attachment 92442 [details]
gzipped big file fileB for testing
Here you have the files to do the test, as attachments of the bug.
I think this is now fixed in grep-2.5.1-26.