So far I've used something like this in scripts, aliases and in the shell:
qstat -u $USER Now I found out that neither the $USER variable nor $USERNAME is not a built-in in bash. While $UID and $EUID are.
I could of course use $(whoami) or stuff like that. There are thounds of ways to find out the user name of the current process. But what's the best, most protable and short one of them and why?
$LOGNAMEto be set, but mentions that$USERis also used. Don't base security decisions on the value of$LOGNAMEor$USERbecause I can doUSER=rootandLOGNAME=rooteven if I'm logged in aspleb.