| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 30/08/2007, Mike <email@hidden> wrote:
> 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.
>From sudo(8):
ENVIRONMENT
...
SUDO_USER Set to the login of the user who invoked sudo
--
James Peach | email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden
This email sent to email@hidden
| References: | |
| >Getting LOGNAME when using sudo (From: Mike <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.