Advertisement
Guest User

Untitled

a guest
Jan 16th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. # function to avoid adding duplicate entries to the PATH
  2. pathmunge () {
  3. case ":${PATH}:" in
  4. *:"$1":*)
  5. ;;
  6. *)
  7. if [ "$2" = "after" ] ; then
  8. PATH=$PATH:$1
  9. else
  10. PATH=$1:$PATH
  11. fi
  12. esac
  13. }
  14.  
  15. # function to avoid adding duplicate entries to the LD_LIBRARY_PATH
  16. ldpathmunge () {
  17. case ":${LD_LIBRARY_PATH}:" in
  18. *:"$1":*)
  19. ;;
  20. *)
  21. if [ "$2" = "after" ] ; then
  22. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$1
  23. else
  24. LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
  25. fi
  26. esac
  27. }
  28.  
  29. # function to avoid adding duplicate entries to the MANPATH
  30. manpathmunge () {
  31. case ":${MANPATH}:" in
  32. *:"$1":*)
  33. ;;
  34. *)
  35. if [ "$2" = "after" ] ; then
  36. MANPATH=$MANPATH:$1
  37. else
  38. MANPATH=$1:$MANPATH
  39. fi
  40. esac
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement