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

 

string='My long string'

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



posted @ 2020-03-24 10:55  Pekkle  阅读(7474)  评论(0编辑  收藏  举报