Grep can find a pattern in a text, but not in a file
- From: "Dimitri Muringer" <dmuringer@xxxxxxxxx>
- Date: 27 Sep 2006 02:31:50 -0700
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 ?
Regards
.
- Follow-Ups:
- Re: Grep can find a pattern in a text, but not in a file
- From: Icarus Sparry
- Re: Grep can find a pattern in a text, but not in a file
- Prev by Date: Re: How to get argv[0] in alias for bashrc
- Next by Date: redirecting stdin and stdout to a file
- Previous by thread: How to get argv[0] in alias for bashrc
- Next by thread: Re: Grep can find a pattern in a text, but not in a file
- Index(es):
Relevant Pages
|