string inside string linux shell code example
Example 1: bash message partial match
if [[ $string == *"foo"* ]]; then
echo "It's there!"
fi
Example 2: substring if statement variable shell script
if [ $string ?? 'foo' ]; then
echo "It's there!"
fi