SUMMARY - Newbie question - determining the logged in user

From: Billy Talton <>
Date: Tue Sep 09 2003 - 11:51:40 EDT
Thanks all for the great idea.....

Reggie Beaver and Jon Godfrey provide with the fastest/simplest solution...
I'll just test the USER variable like so:

if [ ! "$USER" = root ]; then
    #echo "You are not root"
    #echo "You are root"

Thanks for the quick responses.

-Billy Talton

-----Original Message-----
[]On Behalf Of Billy Talton
Sent: Tuesday, September 09, 2003 10:17 AM
Subject: Newbie question - determining the logged in user


I'd like setup a few global variables and 'echos' for my users on my Solaris
8 system.  I'd like to echo messages/instructions conditionally.  I know I
can put such logic in the /etc/profile script.  How can I determine which
users executing this universal script?  I'm really only interested in
non-root users.  Is there any way to determine if the user's root?  Thanks
in advance.

Billy Talton
Cornerstone Consulting, Inc.
sunmanagers mailing list
sunmanagers mailing list
Received on Tue Sep 9 11:53:41 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:19 EST