bashrc & zshrc: don't repeat the PATH so much.

Copied from http://unix.stackexchange.com/a/14896 .
This commit is contained in:
Mikaela Suomalainen 2014-05-29 20:28:25 +03:00
parent 418bb8662f
commit a502ad5201
2 changed files with 6 additions and 0 deletions

3
bashrc
View File

@ -196,6 +196,9 @@ alias pyenv-install-alt="cd ~;git clone https://github.com/yyuu/pyenv.git $PYENV
# Sets PATH. To add another path, add :</path/to/new/path> to string below.
PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$HOME/.local/bin:$HOME/.local/sbin:$HOME/.local/games:$HOME/bin:$HOME/sbin:$HOME/games:$HOME/tmcbeans/bin:/opt/local/bin:/opt/local/sbin:/opt/local/games:/usr/local/bin:/usr/local/sbin:/usr/local/games:/bin:/sbin:/games:/usr/bin:/usr/sbin:/usr/games:$PATH
# Removes duplicates from $PATH. Copied from http://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++')
# Apply pyenv changes.
if [ -d "$PYENV_ROOT" ]; then

3
zshrc
View File

@ -130,6 +130,9 @@ alias pyenv-install-alt="cd ~;git clone https://github.com/yyuu/pyenv.git $PYENV
# Sets PATH. To add another path, add :</path/to/new/path> to string below.
PATH=$PYENV_ROOT/shims:$PYENV_ROOT/bin:$HOME/.local/bin:$HOME/.local/sbin:$HOME/.local/games:$HOME/bin:$HOME/sbin:$HOME/games:$HOME/tmcbeans/bin:/opt/local/bin:/opt/local/sbin:/opt/local/games:/usr/local/bin:/usr/local/sbin:/usr/local/games:/bin:/sbin:/games:/usr/bin:/usr/sbin:/usr/games:$PATH
# Removes duplicates from $PATH. Copied from http://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++')
# Apply pyenv changes.
if [ -d "$PYENV_ROOT" ]; then
eval "$(pyenv init -)"