zprofile-4 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # /etc/zsh/zprofile
  2. # Load environment settings from profile.env, which is created by
  3. # env-update from the files in /etc/env.d
  4. if [[ -e /etc/profile.env ]] ; then
  5. . /etc/profile.env
  6. fi
  7. # You should override these in your ~/.zprofile (or equivalent) for per-user
  8. # settings. For system defaults, you can add a new file in /etc/profile.d/.
  9. export EDITOR=${EDITOR:-/bin/nano}
  10. export PAGER=${PAGER:-/usr/bin/less}
  11. # 077 would be more secure, but 022 is generally quite realistic
  12. umask 022
  13. # Set up PATH depending on whether we're root or a normal user.
  14. # There's no real reason to exclude sbin paths from the normal user,
  15. # but it can make tab-completion easier when they aren't in the
  16. # user's PATH to pollute the executable namespace.
  17. #
  18. # It is intentional in the following line to use || instead of -o.
  19. # This way the evaluation can be short-circuited and calling whoami is
  20. # avoided.
  21. if [[ "${EUID}" = "0" ]] || [[ "${USER}" = "root" ]] ; then
  22. # Check to make sure ROOTPATH is sane before we use it.
  23. # https://bugs.gentoo.org/656400
  24. if [[ -n ${ROOTPATH} ]] && [[ :${ROOTPATH}: == *:/usr/sbin:* ]] ; then
  25. PATH="${ROOTPATH}"
  26. fi
  27. fi
  28. export PATH
  29. unset ROOTPATH
  30. shopts=$-
  31. setopt nullglob
  32. for sh in /etc/profile.d/*.sh ; do
  33. [[ -r "${sh}" ]] && . "${sh}"
  34. done
  35. unsetopt nullglob
  36. set -$shopts
  37. unset sh shopts