X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.bash_profile;h=d2f4fc6e01d66fbfda501cadafd60aedbfbd1bba;hp=81a58de3cac320fe31f1026df1cfef52a7829fa8;hb=815c4966940595d1c924b0e01e82fe99fb1c4a29;hpb=398f1984b032f64f514814f4b6e6067f6326650c diff --git a/.bash_profile b/.bash_profile index 81a58de..d2f4fc6 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,5 +1,24 @@ -# $Id$ -if $(tty -s) || $(shopt -q login_shell); then - for i in ~/.profile.d/*.bashrc; do . $i; done +if tty -s || [ "${0:0:1}" = "-" -o "$1" = "force" ]; then + # Remember if nocaseglob was on. + shopt -q nocaseglob + nocg=$? + # Turn it off so we source stuff in the right order. + shopt -u nocaseglob + + # Remember LC_ALL. + lc_all=$LC_ALL + # Turn it off to set case-sensitive matching + LC_ALL=C + + # Source all scripts. + for i in ${PROFILE_HOME:-~}/.profile.d/*.bashrc; do . "$i"; done; unset i + + # Maybe turn nocaseglob back on. + [ $nocg = 0 ] && shopt -s nocaseglob + + # Reset LC_ALL. + LC_ALL=$lc_all + + unset lc_all nocg __ps1 fi