Path: utzoo!mnetor!uunet!husc6!ukma!nrl-cmf!ames!hc!hi!kurt From: kurt@hi.unm.edu (Kurt Zeilenga) Newsgroups: comp.unix.questions Subject: Re: 4bsd .login and .cshrc Message-ID: <23561@hi.unm.edu> Date: 31 Mar 88 16:25:31 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: kurt@hi.unm.edu (Kurt Zeilenga) Organization: U. of New Mexico, Albuquerque Lines: 44 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 It would really obnoxious if it did source your .login. >so that each shell isn't hashing your path more than necessary). What? I assume you don't want it to be "hasing your path more than necessary" for speed. You need to set your path once per shell to make sure it's right. You don't want to rely on it being correct in the environment. >"rsh hostname something_in_usr_local_bin" will get you a "Command not >found" message. To get around this problem I've renamed .login to >.mylogin and created a new environ variable that let's my .cshrc know >if my .mylogin has been run, if not then .cshrc sources .mylogin. > >In .cshrc: >if ( ! ${?MYLOGIN} ) source ~/.mylogin So you source a script. Now, that makes a lot of sense and I am sure would be much faster than just setting your path .cshrc. If I am doing a rsh, I won't want it to check for mail, news, etc, tset my terminal, etc. Yuk! >This could be cleaned up a little bit (move the env stuff into >.cshrc inside the if MYLOGIN line), but inertia can be quite >overwhelming. >-- >Joe Pruett ...!tektronix!tessi!joey Why don't you put things you want done once per shell in .cshrc and things you want done once per login in .login. If you have stuff that you don't want done when you are doing rsh's (for speed or other reasons) then do a "if ($?prompt) then" or something in your .cshrc. If you want to put something into your .cshrc to do something once per .login, because of some order dependence which you might have, just check for the non-existance of an environment variable you set in your .login (like your MYLOGIN). -- Kurt (zeilenga@hc.dspo.gov)