profile 993 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. # /etc/profile
  2. # Append "$1" to $PATH when not already in.
  3. # This function API is accessible to scripts in /etc/profile.d
  4. append_path () {
  5. case ":$PATH:" in
  6. *:"$1":*)
  7. ;;
  8. *)
  9. PATH="${PATH:+$PATH:}$1"
  10. esac
  11. }
  12. # Append our default paths
  13. append_path '/usr/local/sbin'
  14. append_path '/usr/local/bin'
  15. append_path '/usr/bin'
  16. # Force PATH to be environment
  17. export PATH
  18. # Load profiles from /etc/profile.d
  19. if test -d /etc/profile.d/; then
  20. for profile in /etc/profile.d/*.sh; do
  21. test -r "$profile" && . "$profile"
  22. done
  23. unset profile
  24. fi
  25. # Unload our profile API functions
  26. unset -f append_path
  27. # Source global bash config, when interactive but not posix or sh mode
  28. if test "$BASH" &&\
  29. test "$PS1" &&\
  30. test -z "$POSIXLY_CORRECT" &&\
  31. test "${0#-}" != sh &&\
  32. test -r /etc/bash.bashrc
  33. then
  34. . /etc/bash.bashrc
  35. fi
  36. # Termcap is outdated, old, and crusty, kill it.
  37. unset TERMCAP
  38. # Man is much better than us at figuring this out
  39. unset MANPATH