Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!caen!umich!sharkey!rjf001!mudos!mju From: mju@mudos.ann-arbor.mi.us (Marc Unangst) Newsgroups: comp.unix.xenix.sco Subject: Re: LOGNAME, USER variables under Xenix Message-ID: Date: 30 Apr 91 00:53:17 GMT References: <1991Apr26.231504.9581@bilver.uucp> Organization: The Programmer's Pit Stop, +1 313 665 2832 Lines: 19 bill@bilver.uucp (Bill Vermillion) writes: > Xenix does have a whoami command, except is typed who am i three > words. Bzzt. "who am i" (and the variant, "who am I") is not the same as "whoami", as about 10 seconds of work with a BSD system will tell you. "who am i" basically does a "who" and then greps out the line with your tty name in it. "whoami" gives the login id that corresponds to the current UID. One important diffence is that "who am i" always returns the name in /etc/utmp, but "whoami" looks at the current UID and generates the name from that. This means that "whoami" works as expected when you're su(1)ed to another user, while "who am i" does not. -- Marc Unangst | mju@mudos.ann-arbor.mi.us | "Bus error: passengers dumped" ...!hela!mudos!mju |