tcsh for root -- ok or not?

Felix Lee flee at cs.psu.edu
Tue Apr 9 20:52:36 AEST 1991


>#   When we exec tcsh on an su
>#   we source the person's .cshrc, and we make our home
>#   be the person's home.

There's a simpler and faster way than all that `who am i` `ypmatch`
`awk` nonsense, given that $USER is something sane.
	set home = ~$user

This will fail abominably if $user isn't set, so it should probably be
protected with an if statement.  Something like:
	if (! $?user && $?LOGNAME) set user = $LOGNAME
	if (! $?user) set user = root
	set home = ~$user
--
Felix Lee	flee at cs.psu.edu



More information about the Comp.unix.shell mailing list