Getting LOGNAME when using sudo
Getting LOGNAME when using sudo
- Subject: Getting LOGNAME when using sudo
- From: Mike <email@hidden>
- Date: Thu, 30 Aug 2007 20:52:53 -0700
I have a shell script that needs to get the LOGNAME env variable. But I
need to run my script using sudo which apparently causes LOGNAME to
incorrectly be set to "root".
How can can I get the logged in user's name even when running a script
using sudo?
I need to get the user name because I need to build shell path to the
current user's desktop and only the exact logged in user's name will work.
Thanks,
Mike
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden