######################################################################## # ~/.bashrc # # Notes: # 1) Any text that follows a '#' in a file of bash commands (including # a bash script) is a comment, and is ignored by the bash interpreter # # 2) If you modify this file, you must type # # % source ~/.bashrc # # to have the changes take effect in the current shell. Also, # refer to the 'bash Startup Files' of the Linux / Unix notes at # http://bh0.phas.ubc.ca/210/Notes_unix.html#BASHSTARTUP # for a discussion of the recommended procedure to follow when # changing this file or ~/.profile ######################################################################## #----------------------------------------------------------------------- # Control terminal characteristics (advanced topic!) #----------------------------------------------------------------------- if tty -s; then stty dec export TERM fi #----------------------------------------------------------------------- # Set the path which will be used to locate executables. # Note the inclusion of # the following directories: # # . -> Current working directory. # ~/bin -> 'bin' directory in your home directory, convenient # and standard place to put your own executables # (scripts, programs, etc.) # ~phys210/bin -> 'bin' directory in phys210's home directory (course # account). From time to time, executables that you # might want/need to use may be placed here by the # instructor # # Also note the use of the '\' (backslash) character in the assignment # of PATH to "continue" a long command across one or more lines. # This is a standard mechanism for line continuation in bash and # other shells. # # WARNING!! When you use this mechanism, ensure that NOTHING follows # the '\', including white space, or you will generally induce an error # that can be difficult to debug! In addition, the continuation lines # should always begin in the first column to avoid introducing unwanted # whitespace in the command. #----------------------------------------------------------------------- export \ PATH=.:~/bin:~phys210/bin:/etc:/usr/etc:/usr/ucb:/bin:/usr/bin:/usr/local/bin #----------------------------------------------------------------------- # Set the command prompt to include the hostname (\h), the username (\u), # and the last component (i.e. the basename) of the current working # directory (\W). See 'man bash' and search for 'PROMPTING' for more # information on configuring the prompt. #----------------------------------------------------------------------- PS1="[\u@\h \W]$ " #----------------------------------------------------------------------- # Set various shell options #----------------------------------------------------------------------- set -o noclobber # Do not let output redirection overwrite files. set -o ignoreeof # Disable ^D logout feature. #----------------------------------------------------------------------- # Control command-line history features #----------------------------------------------------------------------- export HISTFILESIZE=1000 # Save 1000 commands in the history export HISTCONTROL=ignoredups # Do no put duplicate lines in the history. #----------------------------------------------------------------------- # Source the ~/.aliases file assuming that it exists, to define aliases #----------------------------------------------------------------------- if [ -f ~/.aliases ]; then source ~/.aliases fi #----------------------------------------------------------------------- # Disable coredumps (advanced topic!) #----------------------------------------------------------------------- ulimit -S -c 0 #----------------------------------------------------------------------- # Enable programmable completion features (advanced topic!) #----------------------------------------------------------------------- if [ -f /etc/bash_completion ]; then . /etc/bash_completion fi