shell check if part of string contains 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