Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!oliveb!jerry From: jerry@oliveb.olivetti.com (Jerry Aguirre) Newsgroups: comp.unix.questions Subject: Re: 4bsd .login and .cshrc Message-ID: <19540@oliveb.olivetti.com> Date: 7 Apr 88 00:04:08 GMT References: <326@ivory.SanDiego.NCR.COM> <7765@apple.Apple.Com> <27717@linus.UUCP> <111@infmx.UUCP> <27@denali.UUCP> <3126@csli.STANFORD.EDU> <453@q7.tessi.UUCP> Reply-To: jerry@oliveb.UUCP (Jerry Aguirre) Organization: Olivetti ATC; Cupertino, Ca Lines: 30 In article <453@q7.tessi.UUCP> joey@tessi.UUCP (Joe Pruett) writes: >As has been mentioned, rsh does not source your .login file. This is >quite obnoxious when you set your path in your .login (where it belongs >so that each shell isn't hashing your path more than necessary). I disagree. My path is set in my .cshrc. The setting is conditional on and environment variable so that sub shells don't reset it. It looks like: if (! $?MAIL) then setenv MAIL /usr/spool/mail/jerry set path=(. ~jerry/bin /usr/ucb /bin /usr/bin) endif This is a lot simpler than inventing new files to be sourced. I bet it is faster too. (I don't remember what program wanted a "MAIL" variable, any environment variable not set at login time would do.) People should also be aware that setting the prompt in their .cshrc should also be conditional. They should use something like: if ($?prompt) then set histchars=\\^ set prompt="\> " history=60 mail=(120 /usr/spool/mail/$USER) alias 1 %1 ... endif Anything dealing with prompts, history, or any other "interactive" variable should be executed only for interactive logins. My opinion is that almost all aliases should also be conditional. An alias is used primarily to save typing and that doesn't apply to non-interactive usage.