How can I use egrep to match word1 but not word2...word1.
What I mean
suppose that I have the following text, and my word1=pizza and word2=eat
I hate to eat pizza because I ma eating it each day
Pizza is good
I like vegetarian and Italian Pizza
eating healthy food is good, but I can not resist The pizza
what about pizza or do you prefer burger
So I want to get
pizza is good
I like vegetarian and Italian Pizza
what about pizza or do you prefer burger
In there is another way to do it without -v for two reasons. The files I am working on is extremely large and I am just interested to see if the pattern exist or not
i.e
Currently I am using
cat $path/tmpFile.csv | egrep "$word1" -i -q
if [ "$?" -eq "0" ]; then
echo "found"
...