Re: Grep can find a pattern in a text, but not in a file



On 27 Sep 2006 10:25:37 GMT, "Icarus Sparry"
<usenet@xxxxxxxxxxxxxxxxx> wrote:

On Wed, 27 Sep 2006 02:31:50 -0700, Dimitri Muringer wrote:

Hi,
Here is the scenario:

One source file ('source.txt') containing a list of software:
excel
emule
notepad

Another file ('pattern.txt') containing a list of standard software:
excel
notepad

I want to find every exotic software in the source file:
$grep -vf pattern.txt source.txt
emule

The result is ok.

But now, I update one soft in the source file:
excel v1.1
emule
notepad

$grep -vf pattern.txt source.txt
excel v1.1
emule

The "excel v1.1" is in the result, but it does contain the term
"excel", so it should not be there!
If I try without a file, the pattern "excel" is correctly taken into
account:
$ echo "excel v1.1" | grep -v excel
$

It seems that the -f option causes the problem.
Any idea to solve this ?

Looks like a bug in your version of grep. It works correctly for me, using
Gnu grep version 2.5.1 on Debian Linux.

Ditto, using "grep (GNU grep) 2.5" on Slackware.


Scott McMillan
.



Relevant Pages