#!/bin/bash # .bashrc #------------------------------------------------------------------------------# # $Id: .bashrc,v 1.11 2005/01/31 20:45:01 awcolley Exp $ #------------------------------------------------------------------------------# # # This script is run at startup by interactive shells. # #------------------------------------------------------------------------------# # Uncomment the following when tracing shell startup # echo ".bashrc run by $$ at `date +'%Y%m%d-%H:%M:%S'`" >> $HOME/suslog #------------------------------------------------------------------------------# # Source .bashrc-ni to get the definitions needed by both interactive and # non-interactive shells, especially PATH and LD_LIBRARY_PATH #------------------------------------------------------------------------------# if [ -f $HOME/.bashrc-ni ] ; then . $HOME/.bashrc-ni fi #------------------------------------------------------------------------------# # CHECK Interactive Shell environment #------------------------------------------------------------------------------# if [ -n "$PS1" ] ; then # Uncomment the following when tracing shell startup # echo "... $$ is an interactive shell for `who -m`" >> $HOME/suslog #------------------------------------------------------------------------------# # BEGIN "if-def wrap" #------------------------------------------------------------------------------# if [ "$BASHRC_DONE" != "$$" ] ; then export BASHRC_DONE="$$" # Uncomment the following when tracing shell startup # echo "... $$ setting BASHRC_DONE to $BASHRC_DONE" >> $HOME/suslog # this is in case you really need to rerun this (e.g. after modifying it) function resetb { export BASHRC_DONE="" } # environment variables for interactive environments export EDITOR="emacs" if [ -z "$DISPLAY" ] ; then export DISPLAY=":0.0" fi #ESTABLISH COLORS FOR ls if [ "$OSTYPE" == "linux" ] ; then eval `dircolors -b $HOME/.lscolors` fi # personalize prompt case $TERM in xterm*) declare -x PS1="\[\033]0; \u@\h: \w\007\][\d \t \!] " ;; *) declare -x PS1="[\d \t \!] " ;; esac # personalize ls if [ "$OSTYPE" == "msys" ] ; then alias ls="ls -aF --color=auto" alias ll="ls -alF --color=auto" alias lt="ls -arot" else alias ls="ls -aFH --color=auto" alias ll="ls -alFH --color=auto" alias lt="ls -arotH" fi # personalize less export LESS="-EimWX" alias more="less" alias mroe="less" alias moer="less" # commands for removing emacs backup files alias pur="rm -f .*~ *~" function purr { if [ $# -gt 0 ] ; then for dir in $* ; do find $dir \( -name "*~" -or -name ".*~" \) -print -exec rm {} \; done else find . \( -name "*~" -or -name ".*~" \) -print -exec rm {} \; fi } # basic commands for switching current directory function go { export CAMEFROM=$PWD cd $* echo Now in $PWD ; } function goback { go $CAMEFROM ; } function up { go .. } # CVS support function cvsroot { export CVSROOT=`cat CVS/Root` echo CVSROOT is now $CVSROOT } # LAM/MPI support alias lamgo="lamboot -v $HOME/etc/lamhosts" alias lamwipe="wipe -v $HOME/etc/lamhosts" # RSYNC shortcut alias rcopy="rsync -arltvz" #------------------------------------------------------------------------------# # Private setup #------------------------------------------------------------------------------# if [ -f $HOME/.bashrc-private ] ; then . $HOME/.bashrc-private fi #------------------------------------------------------------------------------# # END "if-def wrap" #------------------------------------------------------------------------------# fi #------------------------------------------------------------------------------# # END CHECK Interactive Shell environment #------------------------------------------------------------------------------# fi