3 # System wide functions and aliases
4 # Environment stuff goes in /etc/profile
6 # It's NOT good idea to change this file unless you know what you
7 # are doing. Much better way is to create custom.sh shell script in
8 # /etc/profile.d/ to make custom changes to environment. This will
9 # prevent need for merging in future updates.
11 # By default, we want this to get set.
12 # Even for non-interactive, non-login shells.
13 # Current threshold for system reserved uid/gids is 200
14 # You could check uidgid reservation validity in
15 # /usr/share/doc/setup-*/uidgid file
16 if [ $UID -gt 199 ] && [ "`id -gn`" = "`id -un`" ]; then
22 # are we an interactive shell?
26 if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
27 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
29 PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\007"'
33 if [ -e /etc/sysconfig/bash-prompt-screen ]; then
34 PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
36 PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; echo -ne "\033\\"'
40 [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
43 # Turn on checkwinsize
45 [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
46 # You might want to have e.g. tty in prompt (e.g. more virtual machines)
48 # If you want to do so, just add e.g.
50 # PS1="[\u@\h:\l \W]\\$ "
52 # to your custom modification shell script in /etc/profile.d/ directory
55 if ! shopt -q login_shell ; then # We're not a login shell
56 # Need to redefine pathmunge, it get's undefined at the end of /etc/profile
62 if [ "$2" = "after" ] ; then
70 # Only display echos from profile.d scripts if we are no login shell
71 # and interactive - otherwise just process them to set envvars
72 for i in /etc/profile.d/*.sh; do