Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!uunet!mcsun!hp4nl!dri500!slootman From: slootman@dri.nl (Paul Slootman) Newsgroups: comp.unix.xenix.sco Subject: Re: LOGNAME, USER variables under Xenix Message-ID: <1016@dri500.dri.nl> Date: 26 Apr 91 07:10:04 GMT References: <4731@peora.sdc.ccur.com> Organization: DataCount Register Informatici, Wierden, The Netherlands Lines: 24 In article <4731@peora.sdc.ccur.com> tran@peora.sdc.ccur.com (Nhan Tran) writes: > > When I log in Xenix, running /bin/sh, the environment variable LOGNAME >and USER are not set. And Xenix doesn't have whoami command. Is there >any quick way to to get users login id other than id command (which you >have to parse it to get the login id) Use the command "logname"; that works for me. Xenix also recognizes the command "who am i" (note the spaces). However, this also gives you the tty line and login time. Place this in your .profile: LOGNAME=${LOGNAME:-`logname`} USER=${USER:-$LOGNAME} export LOGNAME USER This should work. RTFM for sh(1) if you're not clear on what happens here. Good luck. -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= : slootman@dri.nl : You are wise, witty and wonderful, but you : : ...!hp4nl!dri500!slootman : spend too much time reading this sort of trash. : =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=