Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!ucselx!crash!pnet01!jca From: jca@pnet01.cts.com (John C. Archambeau) Newsgroups: comp.unix.xenix.sco Subject: Re: whoami? Message-ID: <6624@crash.cts.com> Date: 31 Dec 90 04:16:03 GMT Sender: root@crash.cts.com Organization: People-Net [pnet01], El Cajon CA Lines: 28 edhew@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@nosc.mil | EISA or MCA? ** INTERNET: jca@pnet01.cts.com | When will the bus wars end? ** UUCP : {nosc ucsd hplabs!hp-sdd}!crash!pnet01!jca **--------------------------------------------------------------------------* */