Computer History Notes - Herong's Tutorial Notes - v3.12, by Dr. Herong Yang
".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 endif
Table of Contents