Advertisement
ronikuchan

Macos PATH

Mar 23rd, 2020
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. menghapus duplicate PATH on macOS
  2.  
  3. if [ -n "$PATH" ]; then
  4. old_PATH=$PATH:; PATH=
  5. while [ -n "$old_PATH" ]; do
  6. x=${old_PATH%%:*} # the first remaining entry
  7. case $PATH: in
  8. *:"$x":*) ;; # already there
  9. *) PATH=$PATH:$x;; # not there yet
  10. esac
  11. old_PATH=${old_PATH#*:}
  12. done
  13. PATH=${PATH#:}
  14. unset old_PATH x
  15. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement