in reply to how to get which user is on

Some answers to some of your questions:

Alberto Simões

Replies are listed 'Best First'.
Re^2: how to get which user is on
by Fletch (Bishop) on Mar 28, 2005 at 21:14 UTC

    $ENV{HOME} is likely to be the home directory of the current user, but don't count on it. Things such as su, sudo, and cron can commonly either leave it pointing at the wrong place or completely unset). Use the value from getpwuid to be certain.</pedant>