SUMMARY - Newbie question - determining the logged in user

From: Billy Talton <billy.talton_at_cornerstone.net>
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"
    ./DOTHIS_SCRIPT
else
    #echo "You are root"
    ./DOTHAT_SCRIPT
fi

Thanks for the quick responses.

-Billy Talton

-----Original Message-----
From: sunmanagers-bounces@sunmanagers.org
[mailto:sunmanagers-bounces@sunmanagers.org]On Behalf Of Billy Talton
Sent: Tuesday, September 09, 2003 10:17 AM
To: sunmanagers@sunmanagers.org
Subject: Newbie question - determining the logged in user


All,

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.
Sincerely,

Billy Talton
Cornerstone Consulting, Inc.
www.cornerstone.net
414-212-3500/414-467-6827
billy.talton@cornerstone.net
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
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