shell: 判断变量中是否有某个字符 如判断str变量中是否含有this: str="this is a string" if [[ $str =~ "this" ]];then echo "$str contains this." else echo "$str doesn't contain this." fi