用一个shell例子说明=~符号的使用:
先定义一个数组
PLATSS=('center' 'trad')
if [[ "${PLATSS[@]}" =~ ${PLAT} ]];then #
do something
else
do something fi
解析: '=~' 格式表示左边输出数组值包括右边的值,左右顺序不能调换