I have a string in Bash:
string=\"My string\"
How can I test if it contains another string?
if [ $string ?? \'foo\' ]; then
case $string in (*foo*) # Do stuff esac
This is the same answer as https://stackoverflow.com/a/229585/11267590. But simple style and also POSIX Compliant.