我使用 bash 的时间不超过 6 个小时,现在我正在尝试创建一个菜单,让您可以做一些“有趣”的事情:D。
我的问题是if 语句检查您是否处于 sudo 模式。我想有3个条件:
2)
if [ "$EUID" -ne 1 ]
then
echo "Checking if you are in sudo mode..."
echo "Error, please insert your password:"
sudo ls /root
if [ "$EUID" -ne 1 ]
then
echo -e "\nCould not authenticate the user."
echo -e "For security reasons the application will be closed."
exit
else
echo "==============================================================="
echo -e "ALL …Run Code Online (Sandbox Code Playgroud)