我正在尝试编写一个脚本,一开始它仅在用户是以下之一时运行:彼得,保罗,西蒙:
我愿意:
if [[ "$(whoami)" != peter && "$(whoami)" != paul && "$(whoami)" != simon]]; then
echo -e "\nPlease run this script as someone who is allowed" >&2
exit 1
fi
我得到:
syntax error in conditional expression: unexpected token `;'
有小费吗?或者更好,更好的方法来做到这一点?
谢谢