shell |
cmd |
备注 |
bash |
if [[ "aa bb cc" =~ "bb" ]] ; then echo "in";fi |
可以 |
bash |
if [ "aa bb cc" =~ "bb" ] ; then echo "in";fi |
语句非法 |
bash |
if [[ "aa bb cc" = *bb* ]] ; then echo "in";fi |
可以 |
bash |
if [[ "aa bb cc" == *bb* ]] ; then echo "in";fi |
可以 |
bash |
if [[ "aa bb cc" == "*bb*" ]] ; then echo "in";fi |
不可以 |
bash |
if [ "aa bb cc" = *bb* ] ; then echo "in";fi |
不可以 |
bash |
if [ "aa bb cc" = "*bb*" ] ; then echo "in";fi |
不可以 |
bash |
if [[ "aa bb cc" = "*bb*" ]] ; then echo "in";fi |
不可以 |
bash |
if [ "aa bb cc" == "*bb*" ] ; then echo "in";fi |
不可以 |
bash |
if [[ "aa bb cc" == "*bb*" ]] ; then echo "in";fi |
不可以 |
sh |
if [[ "aa bb cc" =~ "bb" ]] ; then echo "in";fi |
语句非法 |
sh |
if [ "aa bb cc" =~ "bb" ] ; then echo "in";fi |
语句非法 |
sh |
if [ "aa bb cc" = "*bb*" ] ; then echo "in";fi |
不可以 |
sh |
if [ "aa bb cc" = *bb* ] ; then echo "in";fi |
不可以 |
sh |
if [[ "aa bb cc" = "*bb*" ]] ; then echo "in";fi |
语句非法 |
sh |
if [ "aa bb cc" == "*bb*" ] ; then echo "in";fi |
语句非法 |
sh |
if [[ "aa bb cc" == "*bb*" ]] ; then echo "in";fi |
语句非法 |
sh |
if [[ "aa bb cc" = *bb* ]] ; then echo "in";fi |
语句非法 |
sh |
if [ "aa bb cc" == *bb* ] ; then echo "in";fi |
语句非法 |
sh |
if [[ "aa bb cc" == *bb* ]] ; then echo "in";fi |
语句非法 |