[comp.unix.questions] .login and .cshrc differences

jmn@cancun.berkeley.edu (Jan Mark Noworolski) (07/10/90)

I used to think that this was a real neophyte type of question- but what
exactly belongs in the .login and .cshrc files respectively?

It seems that rsh only runs .cshrc, rcp gets confused with some .cshrc
contents. 

I want to make sure that my setenv's are in the right place, aliases, and
set path. I use a rsh to start up a remote xterm on a system I use and only
.cshrc gets run in this case. So does this mean my .login may as well be
empty and everything should be in my .cshrc?

As an example of a problem I've run into:
in my .cshrc (outside the 'if ($?prompt)' )
setenv DISPLAY `who am i | sed 's/.*(//' | sed 's/\..*//'`:0
would confuse rcp. After putting it into the 'if' rcp is fine.

Has anybody really nailed down what belongs where and when?

--
"It was very stupid of you to have gotten yourself lured into this trap"
						Big Boy (from Dick Tracy)
jmn@united.berkeley.edu, or jmn@power.berkeley.edu

spotter@desire.wright.edu (07/11/90)

In article <26042@pasteur.Berkeley.EDU>, jmn@cancun.berkeley.edu (Jan Mark Noworolski) writes:
> I used to think that this was a real neophyte type of question- but what
> exactly belongs in the .login and .cshrc files respectively?
> 
> It seems that rsh only runs .cshrc, rcp gets confused with some .cshrc
> contents. 
> 
> I want to make sure that my setenv's are in the right place, aliases, and
> set path. I use a rsh to start up a remote xterm on a system I use and only
> ..cshrc gets run in this case. So does this mean my .login may as well be
> empty and everything should be in my .cshrc?
> 
> Has anybody really nailed down what belongs where and when?

Using the Tektronix Graphics Workstation 4320/4430 Series System Administration
handbook, Section 2 Page 7 defines the .profile, .login, and .cshrc.

"...The .profile dictates the default environment when the Bourne shell command
interpreter is used.  The .login and .cshrc files dictate the default
environment when the C-shell command interpreter is executing.  ...
Refer to the commands sh(1sh) and csh(1csh), and the UTek Tools, Volume 1 (or
whatever you have) for further information."

UTek Tools, Volume 1 Section 2B, page 3:
"When you log in to the system, you are in your home directory.  The system
starts the shell automatically.  As you log in, the shell reads commands from a
file in your home directory called .cshrc.  Each time you invoke a new C Shell,
the commands in this file are read.  Read further in this topic for more
information on what commands to put in the .cshrc file.

"Each time you log in, but not each time you invokle a new shell, a file in
your home directory called .login is read for commands.  After reading the
commands from .cshrc, the login shell reads commands from .login.  Read
further....."

I don't really want to type the next two pages, and I think you probably have a
book very similar handy that will give you the same information.  If you don't
have it, e-mail me, and I can type them in for you.  One thing I can see from
looking at the topics of the next two pages though, is 'if' should be in
cshrc.

Here are the topics:
A SAMPLE .CSHRC FILE
The path variable
The if statement
The history variable
The mail variable
Setting environment variables
Creating aliases

A SAMPLE .LOGIN FILE
The noglob variable
Setting up your terminal
The switch command
The prompt variable

Hope this helps.

Steve
spotter@desire.wright.edu
spotter@eve.wright.edu