Solved

Sample .login and .cshrc for tcsh

Posted on 1998-03-30
2
1,595 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

752 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