.bash_profile 593 B

123456789101112131415161718192021222324252627
  1. # Personal environment variables and startup programs.
  2. # Personal aliases and functions should go in ~/.bashrc. System wide
  3. # environment variables and startup programs are in /etc/profile.
  4. # System wide aliases and functions are in /etc/bashrc.
  5. append () {
  6. # First remove the directory
  7. local IFS=':'
  8. local NEWPATH
  9. for DIR in $PATH; do
  10. if [ "$DIR" != "$1" ]; then
  11. NEWPATH=${NEWPATH:+$NEWPATH:}$DIR
  12. fi
  13. done
  14. # Then append the directory
  15. export PATH=$NEWPATH:$1
  16. }
  17. if [ -f "$HOME/.bashrc" ] ; then
  18. source $HOME/.bashrc
  19. fi
  20. # unset append
  21. # End ~/.bash_profile