${testmystring}
我的.sh脚本中有一个字符串,我想检查该字符串是否不包含另一个字符串。
if [[ ${testmystring} doesNotContain *"c0"* ]];then
# testmystring does not contain c0
fi
我该怎么做,即NotContain应该是什么?
使用!=
。
if [[ ${testmystring} != *"c0"* ]];then
# testmystring does not contain c0
fi
请参阅help [[
以获取更多信息。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句