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 # are we an interactive shell?
13 if [ -z "$PROMPT_COMMAND" ]; then
16 if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
17 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
19 PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
23 if [ -e /etc/sysconfig/bash-prompt-screen ]; then
24 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
26 PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
30 [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
34 # Turn on parallel history
37 # Turn on checkwinsize
39 [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
40 # You might want to have e.g. tty in prompt (e.g. more virtual machines)
42 # If you want to do so, just add e.g.
44 # PS1="[\u@\h:\l \W]\\$ "
46 # to your custom modification shell script in /etc/profile.d/ directory
49 if ! shopt -q login_shell ; then # We're not a login shell
50 # Need to redefine pathmunge, it get's undefined at the end of /etc/profile
56 if [ "$2" = "after" ] ; then
64 # By default, we want umask to get set. This sets it for non-login shell.
65 # Current threshold for system reserved uid/gids is 200
66 # You could check uidgid reservation validity in
67 # /usr/share/doc/setup-*/uidgid file
68 if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
74 # Only display echos from profile.d scripts if we are no login shell
75 # and interactive - otherwise just process them to set envvars
76 for i in /etc/profile.d/*.sh; do