".cshrc" - C Shell Script File and

This section provides an example of .cshrc file, a C shell script file that gets executed automatically each time the C shell is started.

The C shell supports an initialization script file, named as ".cshrc", in your home directory.

# Example of a .cshrc script file. 
   echo "Running .cshrc ..."
   set path = ( $path /local/bin ~/bin )   # Search for my commands 

# Setting aliases
   alias cd            'cd \!*;echo $cwd'
   alias cp            'cp -i'
   alias copy          'cp -i'
   alias mv            'mv -i'
   alias ren           'mv -i'
   alias rm            'rm -i'
   alias del           'rm -i'
   alias where         'echo $cwd'

# Skipping remaining script if this is not an interactive shell
   if ( $?USER == 0 || $?prompt == 0 ) exit

# Settings for interactive shells
   set history = 40  # Saving the last 40 commands in a buffer
   set histsave = 40 # Saving the last 40 commands in .history
   set ignoreeof     # Do not log me out if I hit ^D (EOF key)
   set filec         # Provide me filename completion when hit ESC
   set noclober      # Don't overwrite an existing file
   set mail = ( /usr/spool/mail/herong )  
                     # Watch my mail box everay 5 minutes

# Other aliases for interactive shells
   alias dir         'ls -al | more'
   alias list        cat
   alias type        more
   alias .           'echo $cwd'
   alias ..          'cd ..'
   alias help        man

# Changing the terminal type
   if ( $term == "network" ) then
      set term = vt100

Table of Contents

 About This Book

 1957 - FORTRAN Language Developed by IBM

 1970 - UNIX Operating System Developed by AT&T Bell Labs

 1971 - FTP Protocol Created by Abhay Bhushan

 1972 - C Language Developed by Dennis Ritchie

 1976 - vi Text Editor Developed by Bill Joy

 1977 - Apple II Designed by Steve Jobs and Steve Wozniak

 1977 - The Bourne Shell Developed by Stephen Bourne

1978 - The C Shell Developed by Bill Joy

 What Is the C Shell?

 C Shell Command Line

 Command Line History Substitution

 Command Line Alias Substitution

 Command Line Input and Output Redirection

 Command Line Variable Substitution

 C Shell Command Line Examples

".cshrc" - C Shell Script File and

 1978 - Bash (Bourne-Again Shell) Developed by Brian Fox

 1979 - The Tcsh (TENEX C Shell) Developed by Ken Greer

 1983 - "Sendmail" Mail Transfer Agent Developed by Eric Allman

 1984 - Macintosh Developed by Apple Inc.

 1984 - X Window System Developed a MIT Team

 1991 - WWW (World Wide Web) Developed by Tim Berners-Lee

 1991 - Gopher Protocol Created by a University of Minnesota Team

 1995 - Java Language Developed by Sun Microsystems

 1995 - PHP: Hypertext Preprocessor Created by Rasmus Lerdorf

 2002 - .NET Framework Developed by Microsoft


 PDF Printing Version