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
- Re: Forcing script to run as root? brian . barto
- Re: Forcing script to run as root? John W. Krahn
- Re: Forcing script to run as root? Randal L. Schwartz
- Re: Forcing script to run as root? Tor Hildrum