Path: utzoo!attcan!uunet!cs.utexas.edu!rice!sun-spots-request From: jms@tardis.tymnet.com (Joe Smith) Newsgroups: comp.sys.sun Subject: Re: .login not read at login Keywords: Miscellaneous Message-ID: <9453@brazos.Rice.edu> Date: 29 Jun 90 02:41:37 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 54 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n220, Summary: v9n233 X-Sun-Spots-Digest: Volume 9, Issue 241, message 14 In article <9122@brazos.Rice.edu> bcsaic!chrise@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@tardis.tymnet.com or jms@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."