📅  最后修改于: 2022-03-11 14:50:48.237000             🧑  作者: Mango
[[ $a == z* ]] # True if $a starts with a "z" (wildcard matching).
[[ $a == "z*" ]] # True if $a is equal to z* (literal matching).
if [[ "$HOST" =~ ^user.* ]]; then
echo "yes"
fi
if [[ "$HOST" =~ ^user.*|^host1 ]]; then
echo "yes"
fi