From 399ca7f02e14151377d47b97473fdba7c9b38e3b Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Fri, 5 Sep 2008 23:45:53 +0200 Subject: [PATCH] Also added support to automatically load configuration files to bash. --- bash/rc | 10 ++++++++++ bash/rc.local | 14 ++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 bash/rc.local 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 -- 2.45.2