Hi all. How can I check, within a script, to see if it is being run as root
or not? I would like it to exit with an error message if it is not running
as root. I'm looking for something that works across *nix platforms so that
my script is portable. Is there a perl function that does this or perhaps
checking the uid?
 
I looked at the USER in %ENV but that does not show as root when I su to
root. At least, not in FreeBSD.
 
Thanks,
Brian

Reply via email to