bashrc & zshrc: remove trailing ":" from $PATH.

Source: first comment to the answer linked in this file.
This commit is contained in:
Mikaela Suomalainen 2014-06-15 10:03:20 +03:00
parent c0e4afadc3
commit 6205f7a6db
2 changed files with 2 additions and 2 deletions

2
bashrc
View File

@ -197,7 +197,7 @@ alias pyenv-install-alt="cd ~;git clone https://github.com/yyuu/pyenv.git $PYENV
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]++')
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
# Apply pyenv changes.

2
zshrc
View File

@ -131,7 +131,7 @@ alias pyenv-install-alt="cd ~;git clone https://github.com/yyuu/pyenv.git $PYENV
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]++')
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
# Apply pyenv changes.
if [ -d "$PYENV_ROOT" ]; then