whoami?

John C. Archambeau jca at pnet01.cts.com
Mon Dec 31 15:16:03 AEST 1990


edhew at xenitec.on.ca (Ed Hew) writes:
>Unless I'm missing something, why not simply
>
>if ( `logname` == "root" ) then
>
>	....and so on?

Because logname returns exactly that, your login name.  If you do an su to
root and do a logname it will return the login name of the account you logged
in as not root.

What I want is something that will tell me the login name of the effective
user id.  I haven't tried the code fragment with sed yet, but I did try your
suggestion out and it doesn't work.

I want the equivalent of whoami on BSD/SunOS for SCO Xenix that will work on
both the Bourne and C Shells.

     // JCA

 /*
 **--------------------------------------------------------------------------*
 ** Flames  : /dev/null                     | What to buy?
 ** ARPANET : crash!pnet01!jca at nosc.mil     | EISA or MCA?
 ** INTERNET: jca at pnet01.cts.com            | When will the bus wars end?
 ** UUCP    : {nosc ucsd hplabs!hp-sdd}!crash!pnet01!jca
 **--------------------------------------------------------------------------*
 */



More information about the Comp.unix.xenix.sco mailing list