You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
2.2 KiB

  1. # /etc/profile: login shell setup
  2. #
  3. # That this file is used by any Bourne-shell derivative to setup the
  4. # environment for login shells.
  5. #
  6. # Load environment settings from profile.env, which is created by
  7. # env-update from the files in /etc/env.d
  8. if [ -e /etc/profile.env ] ; then
  9. . /etc/profile.env
  10. fi
  11. # You should override these in your ~/.bashrc (or equivalent) for per-user
  12. # settings. For system defaults, you can add a new file in /etc/profile.d/.
  13. export EDITOR=${EDITOR:-/bin/nano}
  14. export PAGER=${PAGER:-/usr/bin/less}
  15. # 077 would be more secure, but 022 is generally quite realistic
  16. umask 022
  17. # Set up PATH depending on whether we're root or a normal user.
  18. # There's no real reason to exclude sbin paths from the normal user,
  19. # but it can make tab-completion easier when they aren't in the
  20. # user's PATH to pollute the executable namespace.
  21. #
  22. # It is intentional in the following line to use || instead of -o.
  23. # This way the evaluation can be short-circuited and calling whoami is
  24. # avoided.
  25. if [ "$EUID" = "0" ] || [ "$USER" = "root" ] ; then
  26. PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${ROOTPATH}"
  27. else
  28. PATH="/usr/local/bin:/usr/bin:/bin:${PATH}"
  29. fi
  30. export PATH
  31. unset ROOTPATH
  32. if [ -n "${BASH_VERSION}" ] ; then
  33. # Newer bash ebuilds include /etc/bash/bashrc which will setup PS1
  34. # including color. We leave out color here because not all
  35. # terminals support it.
  36. if [ -f /etc/bash/bashrc ] ; then
  37. # Bash login shells run only /etc/profile
  38. # Bash non-login shells run only /etc/bash/bashrc
  39. # Since we want to run /etc/bash/bashrc regardless, we source it
  40. # from here. It is unfortunate that there is no way to do
  41. # this *after* the user's .bash_profile runs (without putting
  42. # it in the user's dot-files), but it shouldn't make any
  43. # difference.
  44. . /etc/bash/bashrc
  45. else
  46. PS1='\u@\h \w \$ '
  47. fi
  48. else
  49. # Setup a bland default prompt. Since this prompt should be useable
  50. # on color and non-color terminals, as well as shells that don't
  51. # understand sequences such as \h, don't put anything special in it.
  52. PS1="${USER:-$(whoami 2>/dev/null)}@$(uname -n 2>/dev/null) \$ "
  53. fi
  54. for sh in /etc/profile.d/*.sh ; do
  55. [ -r "$sh" ] && . "$sh"
  56. done
  57. unset sh