script to grep lines out of a file
I need to configure the below script so that it removes lines from a file that contain words from an input file. As it is now, if you were to place the text one, two and three each on its own line in the input file, instances if onea, oneb, and onec would be also removed (when only lines containing “one” “teo” or ‘three” need to be removed).
Since $i is a variable, quotes or ticks will not help me here. I need this script to be compatible with Linux and HP UX. Any ideas?
# greps out lines from the input file and rewrites to output file:
for i in `cat $INPUT`
cat $FILE | grep -v $i > out
cat out > $FILE