Link to home
Start Free TrialLog in
Avatar of evhead
evhead

asked on

Sample .login and .cshrc for tcsh

Hey all,
      I would like to know if there is a "general" or typical .login and .cshrc I can take and modify for use
on my school (system 5) unix account.  I am currently in a ksh., and want to upgrade to the tcsh.
                                                                                  thanks in advance,  
                                                                                  gs01web@panther.gsu.edu
                                                                                   Evan
ASKER CERTIFIED SOLUTION
Avatar of rbr
rbr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of braveheart
braveheart

Hmm. I think that upgrading from the ksh to the tcsh is an oxymoron. However...

There is no such thing as typical initialisation files but maybe a few guiding principles will help you.

Remember that .cshrc is executed every time you start up a new C shell, whether that is by typing csh at the command line, logging in, or executing a csh command script. Of course you can avoid executing .cshrc in a script by starting it with:
#!/bin/csh -f
where -f means fast.

The .login file is executed once per login session at an interactive terminal, *after* .cshrc, which I always find illogical.

Environment variables are inherited from parent shells but aliases are not, so...

you should initialise terminal control characters, prompts, default file access and maybe some environment variables in your .login file but aliases should be initialised in .cshrc.

You might like to set your prompt so that it contains useful information such as the current directory, or history number, or username (if you use different ones), or hostname (if you use different ones).

Try "man csh" and "man tcsh" for more information.

If you are working in an X oriented environment, you may have a file that is executed once for every session and not per login. This may be called .xsession (or something similar) but this is not standardised between different flavours of UNIX. There are also lots of different ways of initialising X. .xinitrc is another one.