Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!xanth!nic.MR.NET!tank!mimsy!aplcen!wb3ffv!fallst!tkevans From: tkevans@fallst.UUCP (Tim Evans) Newsgroups: comp.unix.xenix Subject: Re: Finding the user name via the shell Summary: Use 'logname' Keywords: shell variables Message-ID: <481@fallst.UUCP> Date: 3 Dec 88 12:25:31 GMT References: <6323@polyslo.CalPoly.EDU> Organization: Tim Evans, Fallston, MD Lines: 18 In article <6323@polyslo.CalPoly.EDU>, mdella@polyslo.CalPoly.EDU (Marcos R. Della) writes: > I was wondering if anyone out there knew how to determine the users > login name while running a shell script. Use the Xenix 'logname' command. To use it in shell scripting, see the following example: #get long listing of $HOME directory and mail to me ls -l $HOME | mail `logname` Other System V *NIX's support the environmental variable $LOGNAME, but Xenix don't! -- UUCP: ...!{rutgers|ames|uunet}!mimsy!aplcen!wb3ffv!fallst!tkevans INTERNET: tkevans%fallst@wb3ffv.ampr.org OTHER: ...!attmail!fallst!tkevans Tim Evans 2201 Brookhaven Court, Fallston, MD 21047 (301) 965-3286