diff --git a/.shrc.d/01env b/.shrc.d/01env index 6588388..2681388 100644 --- a/.shrc.d/01env +++ b/.shrc.d/01env @@ -3,9 +3,7 @@ # path for i in ~/bin; do test -d "$i" || continue - if ! echo ":$PATH:" | fgrep -q ":$i:"; then - PATH="$i:$PATH" - fi + PATH="$i:$PATH" done # mail address diff --git a/.shrc.d/keychain b/.shrc.d/30keychain similarity index 100% rename from .shrc.d/keychain rename to .shrc.d/30keychain diff --git a/.shrc.d/rbenv b/.shrc.d/30rbenv similarity index 100% rename from .shrc.d/rbenv rename to .shrc.d/30rbenv diff --git a/.shrc.d/99path b/.shrc.d/99path new file mode 100644 index 0000000..78dba16 --- /dev/null +++ b/.shrc.d/99path @@ -0,0 +1,4 @@ +# vim: set ft=sh: + +# Remove duplicate entries from PATH +PATH=$(echo "$PATH" | awk -v RS=: '!a[$1]++ { printf (NR > 1 ? ":" : "") $1 }')