in reply to getlogin works on debian but not ubuntu?
getlogin This implements the C library function of the same name +, which on most systems returns the current login from /etc/utm +p, if any. If null, use "getpwuid". $login = getlogin || getpwuid($<) || "Kilroy";
I'm on ubuntu, and this ...
perl -e 'print getlogin || getpwuid($<)' lanx
works for me.
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: getlogin works on debian but not ubuntu?
by bcrowell2 (Friar) on Jan 07, 2013 at 01:33 UTC | |
by LanX (Saint) on Jan 07, 2013 at 01:46 UTC | |
by bcrowell2 (Friar) on Jan 07, 2013 at 01:51 UTC | |
by mbethke (Hermit) on Jan 07, 2013 at 04:04 UTC | |
by bcrowell2 (Friar) on Jan 07, 2013 at 04:23 UTC | |
|