how do I tell inside .cshrc if I'm a login shell?

Maarten Litmaath maart at cs.vu.nl
Sat Aug 4 07:30:33 AEST 1990


I use a scheme like this.
----------------------------------------

# .cshrc

if (! $?CSHLEVEL) then
	setenv	CSHLEVEL	0
	set	home = ~username	# just to be sure
	source ~/.env			# environment stuff we always want
else
	set	tmp = $CSHLEVEL
	@ tmp++
	setenv	CSHLEVEL	$tmp
endif

# exit from .cshrc if not interactive, e.g. under rsh (BSD)
if (! $?prompt) exit

# aliases
# set variables

----------------------------------------

# .env

# umask
# setenv variables

----------------------------------------

# .login

# terminal setup
# startup favourite window environment
--
   "UNIX was never designed to keep people from doing stupid things, because
    that policy would also keep them from doing clever things."  (Doug Gwyn)



More information about the Comp.unix.questions mailing list