dotar/zsh/0_path.zsh
2019-04-10 18:34:31 +08:00

15 lines
440 B
Bash

# path, the 0 in the filename causes this to load first
#
# If you have duplicate entries on your PATH, run this command to fix it:
# PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
pathAppend() {
# Only adds to the path if it's not already there
if ! echo $PATH | egrep -q "(^|:)$1($|:)" ; then
PATH=$PATH:$1
fi
}
pathAppend "$HOME/.yadr/bin"
pathAppend "$HOME/.yadr/bin/yadr"