how to check whether a string is present in a file in linux code example
Example: linux test if string exists in file
if grep -Fxq "string" file.txt; then
echo "Match"
else
echo "No match"
fi
if grep -Fxq "string" file.txt; then
echo "Match"
else
echo "No match"
fi