How to return user name in a script even if run by SUDO?

kapil singh kushwah kapil.network at gmail.com
Tue Apr 7 13:37:24 UTC 2009


Hello ,

It is working fine. I guess you did it
after login as a root.

I am getting :

common at common-laptop:~$ echo ${USER}
common
common at common-laptop:~$ sudo echo ${USER}
common
common at common-laptop:~$


Thanks
Kapil Singh Kushwah
System/Network Administrator
Hotwax Media Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20090407/fede3755/attachment.html>


More information about the ubuntu-users mailing list