4bsd .login and .cshrc

Kurt Zeilenga kurt at hi.unm.edu
Fri Apr 1 02:25:31 AEST 1988


In article <453 at q7.tessi.UUCP> joey at 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 at hc.dspo.gov)



More information about the Comp.unix.questions mailing list