I have a string in Bash:
string=\"My string\"
How can I test if it contains another string?
if [ $string ?? \'foo\' ]; then
I am not sure about using an if statement, but you can get a similar effect with a case statement:
case "$string" in *foo*) # Do stuff ;; esac