From: Simon Ruderich Date: Fri, 5 Sep 2008 21:45:53 +0000 (+0200) Subject: Also added support to automatically load configuration files to bash. X-Git-Url: https://ruderich.org/simon/gitweb/?a=commitdiff_plain;h=399ca7f02e14151377d47b97473fdba7c9b38e3b;hp=486bbbcbb78ff022420640be59ebe72a24cb0882;p=config%2Fdotfiles.git Also added support to automatically load configuration files to bash. --- diff --git a/bash/rc b/bash/rc index 455ce0d..e0563a9 100644 --- a/bash/rc +++ b/bash/rc @@ -8,3 +8,13 @@ export LC_ALL=en_US.UTF-8 export EDITOR='vim' # Use Vi(m) style in bash. set -o vi + + +# If a rc.local file exists load it, otherwise load a rc file for the current +# hostname (first part before a dot) if it exists. +host=$(echo $(hostname) | sed -e 's/\..*$//') +if [ -f ~/.bash/rc.local ]; then + source ~/.bash/rc.local +elif [ -f ~/.bash/rc.$host ]; then + source ~/.bash/rc.$host +fi diff --git a/bash/rc.local b/bash/rc.local new file mode 100644 index 0000000..20490ce --- /dev/null +++ b/bash/rc.local @@ -0,0 +1,14 @@ +# Bash configuration file. + + +# Path to my unix directory which contains useful scripts and configuration +# files. +MYUNIX=$HOME/Documents/unix + +# Default settings for PATH on Mac OS X. +export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin +# Add MacPorts and my unix directory to PATH. +export PATH=$MYUNIX/bin:/opt/local/bin:/opt/local/sbin:$PATH + +# Unset the MANPATH so the value of $PATH is used to search for man pages. +unset MANPATH