미니옵빠의 code stubs

bash shell 내에서 사용자 uid 얻기 본문

OS/Linux

bash shell 내에서 사용자 uid 얻기

미니옵빠 2012. 2. 9. 12:44
기존

if [ "$(id -u)" != "0" ]; then 


새로운 방식

if [[ $EUID -ne 0 ]]; then



참고
http://www.cyberciti.biz/tips/shell-root-user-check-script.html