how to test if user is root or not in a shell script?
hi im making a script that will excecute some commands but you need to be root to do so but i don't know how to check to see if the current user is root or not - how would i do so? Thanks for any replies in advance.
edit: i just realized that i could put the output of whoami to a variable and test against that. but is there another way to do so to increase teh portability of the script? Were does whoami get it from?
Last edited by dr_zayus69; 08-16-2005 at 04:45 PM.