Under SunOS 4.0.3, I executed the following from the csh.
With kparten being me, and other being some other account I have.
$ login other
$ other commands
% who am i
"who am i" checks to see what tty it's being run from (by checking ifQuote:>% sh
>$ login other
>$ other commands
>% who am i
Used without arguments, who lists the login name, terminal
name, and login time for each current user. who gets this
information from the /etc/utmp file.
With two arguments, as in `who am i' (and also `who is
who'), who tells who you are logged in as: it displays your
hostname, login name, terminal name, and login time.
"whoami" doesn't look at "/etc/utmp" at all, the fact that the SunOSQuote:>% whoami
whoami displays the login name corresponding to the current
effective uer ID. If you have used su(1) to temporarily
adopt another user, whoami will report the login name asso-
ciated with that user ID. whoami gets its information from
the geteuid() and getpwuid() library routines (see getuid(2)
and getpwent(3), respectively).
So, in the case you gave, "who am i" reports "other", because when you
did "login other", it overwrote the "/etc/utmp" entry for your tty,
putting in "other" as the login name. "whoami" reports "kparten",
because the shell it was run from was started *before* you did the
"login other", and therefore is running with an effective user ID of
"kparten"; thus, "whoami" is run with the same effective user ID, and
reports the name corresponding to it.
Any comments on the setup of the Matrox Mystique, with Xfree86 would be
12. I am si**y am I?