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?
15 if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
16 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
18 PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
22 if [ -e /etc/sysconfig/bash-prompt-screen ]; then
23 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
25 PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
29 [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
32 # Turn on checkwinsize
34 [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
35 # You might want to have e.g. tty in prompt (e.g. more virtual machines)
37 # If you want to do so, just add e.g.
39 # PS1="[\u@\h:\l \W]\\$ "
41 # to your custom modification shell script in /etc/profile.d/ directory
44 if ! shopt -q login_shell ; then # We're not a login shell
45 # Need to redefine pathmunge, it get's undefined at the end of /etc/profile
51 if [ "$2" = "after" ] ; then
59 # By default, we want umask to get set. This sets it for non-login shell.
60 # Current threshold for system reserved uid/gids is 200
61 # You could check uidgid reservation validity in
62 # /usr/share/doc/setup-*/uidgid file
63 if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
69 # Only display echos from profile.d scripts if we are no login shell
70 # and interactive - otherwise just process them to set envvars
71 for i in /etc/profile.d/*.sh; do
76 . "$i" >/dev/null 2>&1