那是一个奇怪的语法。试试这个:
if echo "$2" | grep -iq "^hibagon|^kameosa";then echo "Continuing to tests"else echo "Unkown server, stopping tests" fi
或者,如果您正在使用bash:
if [[ "$2" =~ ^hibagon ]] || [[ "$2" =~ ^kameosa ]]then echo "Continuing to tests"else echo "Unkown server, stopping tests" fi



