LOGNAME, USER variables under Xenix

Paul Slootman slootman at dri.nl
Fri Apr 26 17:10:04 AEST 1991


In article <4731 at peora.sdc.ccur.com> tran at 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 at dri.nl           : You are wise, witty and wonderful, but you      :
: ...!hp4nl!dri500!slootman : spend too much time reading this sort of trash. :
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



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