Posted By

vikiyou on 03/23/11


Tagged

Bash root


Versions (?)

A simpler check of root


 / Published in: Bash
 

A more simpler method to check root user

  1. # return 1 - is root
  2. # return 0 - not is root
  3. if_root()
  4. {
  5. ((UID != 0)) && return 0
  6. return 1
  7. }

Report this snippet  

You need to login to post a comment.