$ a="hello"
$ b="world"
$ c="hello world"
$ if [[ ${a} =~ ${a} ]]; then echo "true"; else echo "false"; fi
true
$ if [[ ${a} =~ ${b} ]]; then echo "true"; else echo "false"; fi
false
$ if [[ "${a} ${b}" =~ ${c} ]]; then echo "true"; else echo "false"; fi
true
没有评论:
发表评论