2022/09/30

[linux shell] How to check if have root privileges.


1
2
3
4
if [ "${EUID}" -ne 0 ]; then
        echo "Please run as root"
        exit 1
fi




沒有留言: