It seems like not all Unix have whoami. What is the alterate way to display just the login id?
Any help is appreciated
jak
It seems like not all Unix have whoami. What is the alterate way to display just the login id?
Any help is appreciated
jak
Most shells have a USER envrionment variable.
echo $USER
try using id
Thanks .. i will try it out.
FYI, I stumbled upon 'logname' command and it gave me the user id.
Thanks,
jak
if you login as jdoe and then do su - tclark, then echo $USER and logname differ in their output
echo $USER would show tclark while logname would tell you jdoe