how to check if a substring is in line in 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