how to see if a string is a word bash code example
Example: checking if a substring exists in a string bash
string='Haystack';
if [[ $string =~ "Needle" ]]
then
echo "It's there!"
fi
string='Haystack';
if [[ $string =~ "Needle" ]]
then
echo "It's there!"
fi