Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- menghapus duplicate PATH on macOS
- if [ -n "$PATH" ]; then
- old_PATH=$PATH:; PATH=
- while [ -n "$old_PATH" ]; do
- x=${old_PATH%%:*} # the first remaining entry
- case $PATH: in
- *:"$x":*) ;; # already there
- *) PATH=$PATH:$x;; # not there yet
- esac
- old_PATH=${old_PATH#*:}
- done
- PATH=${PATH#:}
- unset old_PATH x
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement