Skip to content

Commit

Permalink
Add PATH cleaner.
Browse files Browse the repository at this point in the history
  • Loading branch information
k-matsuyama committed Jun 30, 2016
1 parent 75b9cbb commit 3e13a24
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .shrc.d/01env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions .shrc.d/99path
Original file line number Diff line number Diff line change
@@ -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 }')

0 comments on commit 3e13a24

Please sign in to comment.