diff --git a/.bashrc b/.bashrc index a979775..ac4085a 100644 --- a/.bashrc +++ b/.bashrc @@ -1,3 +1,9 @@ +pathadd() { + if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; then + PATH="$1${PATH:+":$PATH"}" + fi +} + #-------------------------------------------------------------------------------- # The best editor #-------------------------------------------------------------------------------- @@ -20,7 +26,9 @@ mkdir -p ~/src ~/tmp ~/var/log #-------------------------------------------------------------------------------- # Update the path with local overrides #-------------------------------------------------------------------------------- -export PATH=~/bin:/usr/local/bin:/usr/local/sbin:${PATH} +pathadd /usr/local/sbin +pathadd /usr/local/bin +pathadd ~/bin #-------------------------------------------------------------------------------- #--------------------------------------------------------------------------------