.login not read at login

Joe Smith jms at tardis.tymnet.com
Fri Jun 29 12:41:37 AEST 1990


In article <9122 at brazos.Rice.edu> bcsaic!chrise at beaver.cs.washington.edu (Chris Esposito) writes:
>has started - my .login file is no longer being read when I login, or so
>it seems.  I set several environment variables in .login and then use them
>in .cshrc.  When I log in, the shell complains that OPENWINHOME (the first
>of the aforementioned environment vars) is not set.  If I `source' the
>.login and .cshrc files (in that order) all works fine.

You've got it backwards.  To see what's really happening, save your .cshrc
and .login files, then type 'echo "echo .cshrc" >.cshrc' and 'echo "echo
.login" >.login', and make sure both files are owned by your userid.  Then
when you next login, you will see proof positive that the .login file is
read AFTER .cshrc at login time.

The .login file is also read when you rlogin to your machine, but it is
not when you do an rsh command to your machine (such as "rsh `hostname`
date").

The .login file is NOT read when you open up another window under SunView,
since it reads the environmental variables from memory instead of from
disk.

My .cshrc has a short part that is executed every time the csh is started
up (including all command scripts that start with "#!/bin/csh") and a
longer part that is executed only for an interactive shell.

# [several lines deleted]
#	Ignore the rest of this file when csh is invoked via a pipe.
if ($?USER == 0 || $?prompt == 0) exit
#	The following are definitions suitable for a human at a keyboard.
set filec fignore=(.o .out .d)	# use the ESCape key for file name completion
set notify mail=(15 /usr/spool/mail/$USER) history=500 savehist=500
setenv HOST `hostname`; setenv HOST `basename $HOST .Tymnet.COM`
if ("$prompt" == "% " || "$prompt" == "# ") set prompt="$HOST$prompt"
if ($?userprompt == 0) set userprompt="${USER}@$prompt"
alias tset  'set noglob; eval `\tset -s \!*`'
alias header 'echo'	  # this is redefined in my .suncmd file
alias cd    'cd \!*; header ${HOST}:${cwd}; set cwdh=$cwd:h; set prompt="($cwdh:t/$cwd:t) $userprompt"'
alias pushd 'pushd \!*; cd .'
alias popd  'popd \!*; cd .'
if ($?WINDOW_PARENT) then # windows do not execute .login, must do it here
   source ~/.suncmd  # define header, scroll{off,on} using escape sequences
   #  I like non-scrolling cmdtool windows; they have a nicer left margin.
   if ($term == sun-cmd && `tty` != /dev/ttyp0) then
  	crolloff; tset sun	# ttyp0 is the console window
   endif
   cd $cwd		  # This sets the new prompt
endif

In summary, .login comes after .cshrc execpt for SunView windows.

Joe Smith (408)922-6220 | SMTP: jms at tardis.tymnet.com or jms at gemini.tymnet.com
BT Tymnet Tech Services | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-C41    | BIX: smithjoe | 12 PDP-10s still running! "POPJ P,"
San Jose, CA 95161-9019 | humorous dislaimer: "My Amiga speaks for me."



More information about the Comp.sys.sun mailing list