I have a string in Bash:
string=\"My string\"
How can I test if it contains another string?
if [ $string ?? \'foo\' ]; then
If you prefer the regex approach:
string='My string'; if [[ $string =~ "My" ]]; then echo "It's there!" fi