#!/bin/csh ## Fred says: ## ## This is probably the file you'll find yourself customizing the most. It ## contains settings for tcsh, the default shell on the CSL's Linux machines. ## ## Most of the file is just the defaults provided by the CSL. My additions are ## marked by "Fred says:" ## ## Note that I've removed much of the extra stuff that isn't worth pointing out ## (which you'll probably already have in your copy), so don't just overwrite ## your copy of the file with this one. # Make additions to your path here. Use the following format. # set path = ( $path /path_to_add ) # Sample path addition # The following line should be removed for security, but too # many people get confused if it isn't there. If you remove it, "." (the current # directory will not be in your path, and you will have to type (for example) # "./a.out" instead of "a.out" in order to run the a.out program ## Fred says: ## ## Note that I've removed the line. When I want to run executables in the ## current directory, I have to type "./executable" instead of just "executable" ## -- do as you please with this issue. # set path = ( $path . ) # your current directory # Add aliases here. For more information on aliases, and shell # commands in general, type "man tcsh" ## Fred says: ## ## These three commands (the ones with the -i options) make rm, mv, and cp ask ## your permission before deleting or overwriting files, which is nice because ## it prevents accidental data loss. You can override that feature for a ## particular invocation of the command by adding the -f option. alias rm 'rm -i' # always ask before removing a file alias mv 'mv -i' # always ask before moving a file onto another file alias cp 'cp -i' # always ask before copying a file onto another file alias logout exit # make "logout" work in "script" too ## I really like having the -h and --color options here. alias ls 'ls -bFh --color' # "b" will show control characters as '?' # "F" will show a trailing "/" after directories # and a "*" after executables # "h" puts file sizes in human-readable format # "color" removes all vowels from filenames alias cd.. 'cd ..' # a common typo that I'd rather just have work right alias mcm 'make clean; make' # shortcut for remaking alias xlock 'xlock -mode marquee' # my favorite mode ## This one will make a Purified Microbase: alias mmp 'make; make pmicrobase' ## Remove Emacs backup files: alias rmt 'rm -f *~' ## Remove Emacs backups of hidden (dot) files: alias rmtd 'rm -f .*~' ## Remove non-hidden Emacs backup files in current directory an subdirectories ## up to four levels deep: alias rrmt 'rm -f *~ */*~ */*/*~ */*/*/*~ */*/*/*/*~' ## Remove core files (which can fill up your disk quota quickly): alias rmcore 'rm -f core*' ## Somehow, I do 'l' a lot when I mean to do 'ls': alias l 'ls' ## I can never remember all the arguments I always give to psql: alias psql 'psql -h postgres -p 49173 cs564' ## Launch Firefox and Thunderbird at the same time: alias moz 'firefox & thunderbird &' ## Reload this file after making changes: alias src 'source ~/.cshrc.local' # # this next section is only done for interactive shells # (which have $prompt set) # if ( $?prompt ) then set filec # turn on filename completion in csh set history=40 # how long a history list to keep #set ignoreeof # ignore ^D (^D will not exit the shell) # Remove or comment out the following line (noclobber) if you want # 'ls > foo' to overwrite foo. set noclobber # can't > to existing files set mail = (/usr/spool/mail/$USER) # what file to check for new mail set notify # report change in jobs' status # your prompt shows the hostname (useful if you open windows to more # than one workstation) and the command number (which can be used with # the shell's history mechanism to repeat commands) # set prompt = "${HOSTNAME}(\!)% " ## Fred says: ## Ignore the previous paragraph. I've changed my prompt to be the way I ## like it. This adds colors and gives me something of the form: ## bundost|15:19(0) ## where the first word is the current host machine, the second part is the ## current time (24-hour), and the number in parentheses is the exit code of ## the last command (bold and red if not 0). You may not care, but that's ## the way I like it. set NORMAL="%{\033[0m%}" set RED="%{\033[31;1m%}" set BLUE="%{\033[00;34m%}" set SELECT="%{\033[31;1;%?m%}" set prompt = "${BLUE}%U${HOSTNAME}%u${NORMAL}|${BLUE}%U%T%u${NORMAL}(${SELECT}%?${NORMAL}) " ## The next two lines enable correction: If you enter a command that tcsh ## thinks is similar to another command it knows, it will suggest a ## correction. This is useful when you accidentally enter a bogus command, ## but annoying when it messes up, so I used it for a while and then ## disabled it. #set correct=all # tcsh will try to correct bad commands #set prompt3 = "%{\033[00;34m%}?: %{\033[00;30m%}%R %{\033[00;34m%}(y|n|e|a)%{\033[00;30m%} " if ($?TERM) then if ($TERM == xterm) then # define 'mytitle' alias to set title bars on xterms alias icon_name 'set icon_name = /`echo $cwd | sed -e s-.\*/--`' alias mytitle 'icon_name; echo -n ]1\;$icon_name\]2\;$HOSTNAME\: $cwd\' # define 'name', 'icon', and 'title' aliases to allow the user # to give her xterm windows names by hand. alias name 'echo -n ]0\;\!*\' alias icon 'echo -n ]1\;\!*\' alias title 'echo -n ]2\;\!*\' # use xrs (resize) to reset your window size after you have resized # an xterm. alias xrs 'set noglob; eval `resize`; unset noglob' ## Fred says: ## This says it all. I highly recommend it! # un-comment out the following lines if you want the machine # name and current directory to appear in the titlebar and # the last part of the current directory to appear in the # icon manager. # ## (I already uncommented the lines in my copy of the file.) mytitle alias cd 'chdir \!*; mytitle' alias pushd 'pushd \!*; mytitle' alias popd 'popd \!*; mytitle' endif endif endif ## Fred says: ## ## You'll need to do this for the Microbase project, supplying the path to your ## own copy of Microbase: setenv MICROBASE_ROOT /u/f/r/fredrick/564/microbase #environment variable for 564 microbase project ## ## This is where I guess I decided to put my path additions. Your path is the ## list of directories where tcsh looks for commands that you type. ## ## This will allow you to run psql (for the SQL assignment) without entering the ## full path: setenv PATH ${PATH}:/s/postgresql/bin/ ## This allows you to waste time by running the command 'fortune', which gives ## witty and/or stupid quotes: setenv PATH ${PATH}:/unsup/fortune-mod/bin/ ## Stuff I've needed when working with Java: setenv CLASSPATH .:./classes:/s/java/jre/lib/ #rt.jar #:/p/course/cs536-fischer/public/JAVA ## This allows you to make it start snowing on your desktop by running 'xsnow': setenv PATH ${PATH}:/unsup/xsnow/bin/ ## ## I don't even remember what this is for: setenv VPATH ./classes ## ## Specifies the editor that should be used when the shell needs to choose a ## text editor for something (e.g., when entering a summary of your changes as ## you commit changes to CVS); I added the -nw option so that XEmacs would run ## in the terminal window instead of launching a new window (which is faster): setenv EDITOR 'xemacs -nw' ## If CVSEDITOR is set, CVS will choose it (see previous paragraph) over EDITOR. ## It's a moot point here, since I set both variables to the same value, but I ## could set them to different things if I had some reason to. setenv CVSEDITOR "xemacs -nw" ## Fred says: ## ## Extra credit: You can conditionally add things to this file. As an example, ## if I'm logged into my office machine (bundost), I set the PRINTER variable to ## 3a (causing lp/lpr/whatever to print to the third-floor printer), since my ## office is on the third floor. You can enclose any set of commands in ## conditional blocks. if($HOSTNAME == bundost) then setenv PRINTER 3a endif ## ## ## You can also act on conditions other than the current machine's name. ## $?prompt is true iff your shell is presenting you with a prompt for entering ## arbitrary commands. This means tsch gives me a little 'fortune' message and ## a greeting when I log in normally (or over ssh), but not when running scripts ## or when making CVS on my home machine connect to my work machine (which would ## anger CVS). if($?prompt) then fortune echo echo Welcome to $HOSTNAME. endif