Path: utzoo!utgpu!water!watmath!clyde!att-cb!att-ih!gargoyle!oddjob!nucsrl!gore From: gore@eecs.nwu.edu (Jacob Gore) Newsgroups: comp.unix.questions Subject: Re: Re: 4bsd .login and .cshrc Message-ID: <3680033@eecs.nwu.edu> Date: 27 Mar 88 20:32:37 GMT References: <27717@linus.UUCP> Organization: Northwestern U, Evanston IL, USA Lines: 39 / comp.unix.questions / gandalf@csli.STANFORD.EDU (Juergen Wagner) / Mar 27, 1988 / >The point is that .cshrc is executed every time a csh starts ([...]). >Put in this file everything you'd like to have in every csh. Put into >.login everything you need in the login shell, and all environment variables >not needed in all cshs. Also, terminal setup (tset, stty, biff, ...) should >be in .login because in .cshrc it doesn't make sense. I find that this sequence (.cshrc first, then .login) is the opposite of what I want. That is because I want to set up environment variables just once -- in .login, -- and I want them to be usable from .cshrc in each shell I use, including the login shell. So, I just reverse them: .login (abbridged): setenv EDITOR /usr/local/bin/mg unset autologout set prompt="%m"; setenv SHOSTNAME $prompt biff y setenv HAVELOGGEDIN yes source ~/.tcshrc .tcshrc (abbridged): if (${?HAVELOGGEDIN}) then source ~/.customrc set prompt="`whoami`@${SHOSTNAME}> " set history=50 savehist=20 endif This way, when the login shell starts up, .tcshrc skips itself (because HAVELOGGEDIN is not defined), .login is run, and it runs .tcshrc when it's finished. On subsequent shells, just the .tcshrc is run, and it executes normally. Jacob Gore Gore@EECS.NWU.Edu Northwestern Univ., EECS Dept. {oddjob,gargoyle,ihnp4}!nucsrl!gore