# are we an interactive shell?
if [ "$PS1" ]; then
+ if [ -z "$PROMPT_COMMAND" ]; then
case $TERM in
xterm*)
- if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
- PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
- else
- PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
- fi
- ;;
+ if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
+ PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
+ else
+ PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
+ fi
+ ;;
screen)
- if [ -e /etc/sysconfig/bash-prompt-screen ]; then
- PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
- else
- PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
- fi
- ;;
+ if [ -e /etc/sysconfig/bash-prompt-screen ]; then
+ PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
+ else
+ PROMPT_COMMAND='printf "\033]0;%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
+ fi
+ ;;
*)
- [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
- ;;
+ [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
+ ;;
esac
- # Turn on checkwinsize
- shopt -s checkwinsize
- [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
- # You might want to have e.g. tty in prompt (e.g. more virtual machines)
- # and console windows
- # If you want to do so, just add e.g.
- # if [ "$PS1" ]; then
- # PS1="[\u@\h:\l \W]\\$ "
- # fi
- # to your custom modification shell script in /etc/profile.d/ directory
+ fi
+ # Turn on parallel history
+ shopt -s histappend
+ history -a
+ # Turn on checkwinsize
+ shopt -s checkwinsize
+ [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
+ # You might want to have e.g. tty in prompt (e.g. more virtual machines)
+ # and console windows
+ # If you want to do so, just add e.g.
+ # if [ "$PS1" ]; then
+ # PS1="[\u@\h:\l \W]\\$ "
+ # fi
+ # to your custom modification shell script in /etc/profile.d/ directory
fi
if ! shopt -q login_shell ; then # We're not a login shell
if [ "$PS1" ]; then
. "$i"
else
- . "$i" >/dev/null 2>&1
+ . "$i" >/dev/null
fi
fi
done
unset i
- unset pathmunge
+ unset -f pathmunge
fi
# vim:ts=4:sw=4