Bash test for for current user

Bash test for for current user is root

if [ `id -u` = 0 ]; then
echo root;
fi

Comments

Abbakus said…
Good one.

Thank you.

Popular posts from this blog

Vim vi how to reload a file your editing