在 Bash 中,如何检查字符串是否以某个值开头?

if [ $HOST == user* ]
  then
  echo yes
fi
if [ [[ $HOST == user1 ]] -o [[ $HOST == node* ]] ];
then
echo yes
fi

> > > -bash: [: too many arguments

答案