Skip to content

Instantly share code, notes, and snippets.

@slumos
Created March 18, 2013 17:08
Show Gist options
  • Save slumos/5188882 to your computer and use it in GitHub Desktop.
Save slumos/5188882 to your computer and use it in GitHub Desktop.
typeset -U path
typeset -U manpath
function addpath {
[[ -d "$1" ]] && path=("$1" $path)
[[ -d "${1:h}/sbin" ]] && path=("${1:h}/sbin" $path)
for d in "${1:h}"/{man,share/man}; do
[[ -d "$d" ]] && manpath=("$d" $manpath)
done
}
addpath /usr/local/bin
addpath /usr/local/sbin
addpath ~/.rbenv/bin
addpath $HOME/bin
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment