On 26 Jun 2001 14:38:26 +0200, Matija Papec wrote:
> 
> Greetings,
> 
> is there a more elegant way to find out who is running a script? %ENV is
> not reliable and it doesn't contain USER when booting the system, and
> "whoami" is external command(yuck :) ) tnx!
> 
> 
> 
> --
> Matija
>

<snip href="perldoc -f getlogin">
getlogin
               Implements the C library function of the same
               name, which on most systems returns the current
               login from /etc/utmp, if any.  If null, use
               "getpwuid".

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

               Do not consider "getlogin" for authentication: it
               is not as secure as "getpwuid".
</snip>
 
--
Today is Boomtime, the 31st day of Confusion in the YOLD 3167
Frink!


Reply via email to