X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=bashrc;h=5ef300fb445ea311b3f75044796ac68387864520;hb=e5eadd5d78257a60a530d29f7643dd5c472eb910;hp=707e427414b2019a715cc29d66e1c8f54dababde;hpb=4556fc708c4789bfd37f6540755efb42e1d21511;p=packages%2Fbash.git diff --git a/bashrc b/bashrc index 707e427..5ef300f 100644 --- a/bashrc +++ b/bashrc @@ -3,15 +3,30 @@ # System wide functions and aliases # Environment stuff goes in /etc/profile -# For some unknown reason bash refuses to inherit -# PS1 in some circumstances that I can't figure out. -# Putting PS1 here ensures that it gets loaded every time. +# 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 + +# If this is an xterm set the title to user@host:dir +case $TERM in + gnome*|nxterm|xterm*|rxvt*|konsole*) + PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"' + ;; + *) + ;; +esac PS1="[\u@\h \W]\\$ " alias which="type -p" -for I in /etc/profile.d/*.sh ; do - if [ "`grep alias $I`" != "" ]; then - . $I - fi -done +# SYSTEM WIDE ALIASES ETC. +if [ "$(echo /etc/shrc.d/*.sh)" != "/etc/shrc.d/*.sh" ]; then + for i in /etc/shrc.d/*.sh; do + . $i + done + unset i +fi