Advertisement
Guest User

Untitled

a guest
Sep 19th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.69 KB | None | 0 0
  1. $ cat /etc/bashrc
  2. # /etc/bashrc
  3.  
  4. # System wide functions and aliases
  5. # Environment stuff goes in /etc/profile
  6.  
  7. # It's NOT a good idea to change this file unless you know what you
  8. # are doing. It's much better to create a custom.sh shell script in
  9. # /etc/profile.d/ to make custom changes to your environment, as this
  10. # will prevent the need for merging in future updates.
  11.  
  12. # are we an interactive shell?
  13. if [ "$PS1" ]; then
  14. if [ -z "$PROMPT_COMMAND" ]; then
  15. case $TERM in
  16. xterm*|vte*)
  17. if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
  18. PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
  19. elif [ "${VTE_VERSION:-0}" -ge 3405 ]; then
  20. PROMPT_COMMAND="__vte_prompt_command"
  21. else
  22. PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
  23. fi
  24. ;;
  25. screen*)
  26. if [ -e /etc/sysconfig/bash-prompt-screen ]; then
  27. PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
  28. else
  29. PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
  30. fi
  31. ;;
  32. *)
  33. [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
  34. ;;
  35. esac
  36. fi
  37. # Turn on parallel history
  38. shopt -s histappend
  39. history -a
  40. # Turn on checkwinsize
  41. shopt -s checkwinsize
  42. [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
  43. # You might want to have e.g. tty in prompt (e.g. more virtual machines)
  44. # and console windows
  45. # If you want to do so, just add e.g.
  46. # if [ "$PS1" ]; then
  47. # PS1="[\u@\h:\l \W]\\$ "
  48. # fi
  49. # to your custom modification shell script in /etc/profile.d/ directory
  50. fi
  51.  
  52. if ! shopt -q login_shell ; then # We're not a login shell
  53. # Need to redefine pathmunge, it get's undefined at the end of /etc/profile
  54. pathmunge () {
  55. case ":${PATH}:" in
  56. *:"$1":*)
  57. ;;
  58. *)
  59. if [ "$2" = "after" ] ; then
  60. PATH=$PATH:$1
  61. else
  62. PATH=$1:$PATH
  63. fi
  64. esac
  65. }
  66.  
  67. # By default, we want umask to get set. This sets it for non-login shell.
  68. # Current threshold for system reserved uid/gids is 200
  69. # You could check uidgid reservation validity in
  70. # /usr/share/doc/setup-*/uidgid file
  71. if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
  72. umask 002
  73. else
  74. umask 022
  75. fi
  76.  
  77. # Only display echos from profile.d scripts if we are no login shell
  78. # and interactive - otherwise just process them to set envvars
  79. for i in /etc/profile.d/*.sh; do
  80. if [ -r "$i" ]; then
  81. if [ "$PS1" ]; then
  82. . "$i"
  83. else
  84. . "$i" >/dev/null
  85. fi
  86. fi
  87. done
  88.  
  89. unset i
  90. unset -f pathmunge
  91. fi
  92. # vim:ts=4:sw=4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement