]> ruderich.org/simon Gitweb - config/dotfiles.git/commitdiff
Also added support to automatically load configuration files to bash.
authorSimon Ruderich <simon@ruderich.org>
Fri, 5 Sep 2008 21:45:53 +0000 (23:45 +0200)
committerSimon Ruderich <simon@ruderich.org>
Fri, 5 Sep 2008 21:45:53 +0000 (23:45 +0200)
bash/rc
bash/rc.local [new file with mode: 0644]

diff --git a/bash/rc b/bash/rc
index 455ce0dd0eeb32b610cce470a374246cd0e99d61..e0563a93942dbe0d4b2ba15264874185c1508356 100644 (file)
--- 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 (file)
index 0000000..20490ce
--- /dev/null
@@ -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