I want to be able to grep for exact match results without outputting those with text in between my searched words. the middle being part of the output. For example:
egrep -i "^cat|^dog" list.txt >> startswith.txt egrep -i "home$|house$" startswith.txt >> final.txt
I want this to return any matches for cathome, cathouse, doghome, doghouse; but not return cathasahome, catneedsahouse, etc. Take note that the files would be wayyy to big for me to go through and say ^word1word2$ in every combination.
Is there a way to do this within grep or egrep.