if echo "$string" | grep 'foo'; then echo "It's there!" fi
string="My string"
if [ $string ?? 'foo' ]; then echo "It's there!" fi