Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. # This script is sourced from all over the place to fix broken shells.
  2. # It does assume you have at *least* /usr/bin:/bin though.
  3.  
  4. # Significant care is taken to be sh-compatible; if bash or zsh could be
  5. # required, it could be made simpler or more generic.
  6.  
  7. has_PATH () {
  8. local tmp=":$PATH:"
  9. [ "${tmp}" != "${tmp#*:$1:}" ]
  10. }
  11.  
  12. prepend_PATH () {
  13. has_PATH "$1" || PATH="$1:$PATH"
  14. }
  15.  
  16. append_PATH () {
  17. has_PATH "$1" || PATH="$PATH:$1"
  18. }
  19.  
  20. prepend_PATH /usr/local/bin
  21. prepend_PATH ~/.local/bin
  22. prepend_PATH ~/bin
  23. prepend_PATH /usr/lib/ccache
  24. append_PATH /usr/local/games
  25. append_PATH /usr/games
  26. export PATH
  27.  
  28. # Known source'rs:
  29. # ~/.profile
  30. # ~/.zshrc
  31. # ~/.xprofile
  32. # ~/.xsessionrc
  33. # ~/.bashrc
  34. # ~/.config/plasma-workspace/env/path.sh
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement