# /etc/bash/bashrc # # This file is sourced by all *interactive* bash shells on startup, # including some apparently interactive shells such as scp and rcp # that can't tolerate any output. So make sure this doesn't display # anything or bad things will happen ! #echo Been here done that? if [[ ${SHLVL} = 1 ]] || [[ ${SHLVL} = 2 && ${TERM}="screen" ]] ; then source /etc/bash/shlvl1 source /etc/bash/pathrc #echo Tricky, in case the sub shell is run as someone else, especially root where we should change the path elif [[ ${USER} != ${USERNAME} ]] ; then source /etc/bash/pathrc # Includes the old users bin directory in the new PATH. if [ -n ${USERNAME} ] ; then PATH=$PATH:/home/$USERNAME/bin fi fi # Don't want to run X apps from root shells. if [[ $EUID = "0" ]] ; then unset DISPLAY fi # # Bash configuration # export CDPATH=".:~/:/usr:/pub/archive:/usr/share/doc" export FIGNORE="~" export HISTCONTROL="ignoresoace:erasedups" export HISTFILESIZE="10000" export HISTSIZE="10000" export HISTIGNORE="knock*" unset MAILCHECK PROMPT_COMMAND="history -a;history -c;history -r" export CCACHE_DIR="/var/tmp/ccache" shopt -s cdspell # # vserver # export soap_use_proxy=on # apt-get issue # Bash won't get SIGWINCH if another process is in the foreground. # Enable checkwinsize so that bash will check the terminal size when # it regains control. #65623 # http://cnswww.cns.cwru.edu/~chet/bash/FAQ (E11) shopt -s checkwinsize # Enable history appending instead of overwriting. #139609 shopt -s histappend shopt -s checkhash shopt -s cmdhist shopt -s dotglob shopt -s histreedit shopt -s no_empty_cmd_completion # Test for an interactive shell. There is no need to set anything # past this point for scp and rcp, and it's important to refrain from # outputting anything in those cases. if [[ $- != *i* ]] ; then # Shell is non-interactive. Be done now! return fi # Set colorful PS1 only on colorful terminals. # dircolors --print-database uses its own built-in database # instead of using /etc/DIR_COLORS. Try to use the external file # first to take advantage of user additions. Use internal bash # globbing instead of external grep binary. use_color=false safe_term=${TERM//[^[:alnum:]]/?} # sanitize TERM match_lhs="" [[ -f ~/.dir_colors ]] && match_lhs="${match_lhs}$(<~/.dir_colors)" [[ -f /etc/DIR_COLORS ]] && match_lhs="${match_lhs}$(