如何检查 umask 是否阻止设置组位?我的尝试:
#!/bin/sh
out=$(umask)
echo "$out"
if (($out & 070) != 0); then
echo "$out"
echo "Incorrect umask" > /dev/tty
exit 1
fi
输出:
./test.sh: line 6: syntax error near unexpected token `!='
./test.sh: line 6: `if (($out & 070) != 0); then'
如果它使事情变得更容易,我可以切换到 bash。