I have a string in Bash:
string=\"My string\"
How can I test if it contains another string?
if [ $string ?? \'foo\' ]; then
Exact word match:
string='My long string' exactSearch='long' if grep -E -q "\b${exactSearch}\b" <<<${string} >/dev/null 2>&1 then echo "It's there" fi