Finding the user name via the shell

Tim Evans tkevans at fallst.UUCP
Sat Dec 3 22:25:31 AEST 1988


In article <6323 at polyslo.CalPoly.EDU>, mdella at 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 at wb3ffv.ampr.org
OTHER: ...!attmail!fallst!tkevans
Tim Evans  2201 Brookhaven Court, Fallston, MD  21047   (301) 965-3286



More information about the Comp.unix.xenix mailing list