I have a string in Bash:
How can I test if it contains another string?
if [ $string ?? 'foo' ]; then echo "It's there!" fi
?? is my unknown operator. Do I use
if echo "$string" | grep 'foo'; then echo "It's there!" fi
That looks a bit clumsy.