In reply to Mark Johnson's words, written Tue, 23 Oct 2001 10:18:02 -0500
Check the value of $UID. It should be 0 for root.
Paul
I'm trying to write a bash script to install some files but it must be run
as root. Is there a way that I can get my script to check to see if it has
root
You could try 'whoami'.
Michael
--
Michael Viron
Registered Linux User #81978
Senior Systems Administration Consultant
Web Spinners, University of West Florida
At 10:18 AM 10/23/2001 -0500, you wrote:
I'm trying to write a bash script to install some files but it must be run
as root. Is
-
From: Paul [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 23, 2001 11:42 PM
To: [EMAIL PROTECTED]
Subject: Re: [newbie] How can I determine if I'm root in a script
In reply to Mark Johnson's words, written Tue, 23 Oct 2001 10:18:02 -0500
Check the value of $UID. It should be 0 for root.
Paul
Hi,
you can check to see if you are root, i.e.:
`whoami` == root
if that returns true, you are good to go. (btw, those are backticks around
whoami)
HTH,
David Charles
On Tue, 23 Oct 2001, Mark Johnson wrote:
I'm trying to write a bash script to install some files but it must be run
as