Solved

Sample .login and .cshrc for tcsh

Posted on 1998-03-30
2
1,608 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:evhead
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 50 total points
ID: 2009054
1.) .login
# This is the default standard .login provided to csh users.
# They are expected to edit it to meet their own needs.
#
# The commands in this file are executed when a csh user first
# logs in.  This file is processed after .cshrc.
#
# $Revision: 1.8 $
#

# Set the interrupt character to Ctrl-c and do clean backspacing.
alias l ls -la
alias rm rm -i
alias del rm -i
alias alld "'rm'"
alias mail Mail
alias wipe "'rm' -r"

if (-t 0) then
    stty intr '^C' echoe
endif

# Set the TERM environment variable
eval `tset -s -Q`

# Set the default X server.
if ($?DISPLAY == 0) then
    if ($?REMOTEHOST) then
        setenv DISPLAY ${REMOTEHOST}:0
    else
        setenv DISPLAY :0
    endif
endif
umask 77
alld $home/.spooler/* > /dev/null
alld $home/tmp/* > /dev/null
alld $home/usr/* > /dev/null
alld -r .netscape/cache/*
alld .netscape-cache/*
setenv TERM vt100


2.) .cshrc
# This is the default standard .cshrc provided to csh users.
# They are expected to edit it to meet their own needs.
#
# The commands in this file are executed each time a new csh shell
# is started.
#
# $Revision: 1.6 $
#

# list directories in columns
alias ls 'ls -C'

# Remember last 100 commands
set history = 100

# For interactive shells, set the prompt to show the host name and event number.
if ( $?prompt ) then
        if ( -o /bin/su ) then
                set prompt="`hostname -s` \!# "
        else
                set prompt="`hostname -s` \!% "
        endif
endif
setenv PRINTER tp_b
setenv TMPDIR ~/tmp
set path = (/usr/etc $home/work/cmd $home/work/tsk $home/tools /usr/local/bin $path)
0
 
LVL 3

Expert Comment

by:braveheart
ID: 2009055
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.
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question