GETLOGIN

getlogin

Returns the current login from /etc/utmp, if any. If null, use getpwuid() .

$login = getlogin || (getpwuid($<))[0] || "Kilroy";

Back to functions