3 # System wide functions and aliases
4 # Environment stuff goes in /etc/profile
6 # It's NOT a good idea to change this file unless you know what you
7 # are doing. It's much better to create a custom.sh shell script in
8 # /etc/profile.d/ to make custom changes to your environment, as this
9 # will prevent the need for merging in future updates.
11 # Prevent doublesourcing
12 if [ -z "$BASHRCSOURCED" ]; then
15 # are we an interactive shell?
17 if [ -z "$PROMPT_COMMAND" ]; then
20 if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
21 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
23 PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
27 if [ -e /etc/sysconfig/bash-prompt-screen ]; then
28 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
30 PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
34 [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
38 # Turn on parallel history
40 # Turn on 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)
45 # If you want to do so, just add e.g.
47 # PS1="[\u@\h:\l \W]\\$ "
49 # to your custom modification shell script in /etc/profile.d/ directory
52 if ! shopt -q login_shell ; then # We're not a login shell
53 # Need to redefine pathmunge, it gets undefined at the end of /etc/profile
59 if [ "$2" = "after" ] ; then
67 # Set default umask for non-login shell only if it is set to 0
68 [ `umask` -eq 0 ] && umask 022
71 # Only display echos from profile.d scripts if we are no login shell
72 # and interactive - otherwise just process them to set envvars
73 for i in /etc/profile.d/*.sh; do