I can't figure this out. I need to look at every line in a file and check whether it matches a word that is given in a variable.
I started with command read
, but I don't know what I am supposed to use after that. I tried grep
, but I probably used it wrongly.
while read line; do
if [ $condition ] ;then echo "ok" fi
done < file.txt