Linux shell if 判断字符串包含子串

string='My long string'

if [[ $string == *"My long"* ]] || [[ $string == *"my long"* ]]; then
echo "It's there"
fi



原文地址:https://www.cnblogs.com/pekkle/p/12557566.html