The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
checking uid
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
checking uid
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
1
(
permalink
)
07-19-2007
filthymonk
Registered User
Join Date: May 2007
Posts: 59
checking uid
How do i go about getting the uid of the user and verify ?
Code:
if [ $uid != 'root' ] then echo "You are not a superuser, please login as a superuser" exit1; fi
the above code doesn't work. can some guru please help me.
1. how to get the uid of the user ? i know by typing id but how to get the script to verify its a su?
2. how do i exit the whole script if he/she is not a su?
3. Is the above, able to continue the rest of the process if its a su?
-Thanks & Regards-
filthymonk
View Public Profile
Find all posts by filthymonk
Find filthymonk's past nominations received
Find filthymonk's present nominations given