X-Git-Url: http://git.iain.cx/?p=profile.git;a=blobdiff_plain;f=.bash_profile;h=6fe0759a4575e80ef646ccf8a3a6cca7a9082ba0;hp=56a1eb045aea29fd7c919f03b9e981d7bbe2a872;hb=546a2177e8c7dcda6895b25c5f4b0f6e83707e1d;hpb=7a9aad0d435f7afcc06fdbadb8764646a2c18cb6 diff --git a/.bash_profile b/.bash_profile index 56a1eb0..6fe0759 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,4 +1,4 @@ -if tty -s || [ "${0:0:1}" = "-" -o "$1" = "force" ]; then +if [ -t 0 -o "${0:0:1}" = "-" -o "$1" = "force" ]; then # Remember if nocaseglob was on. shopt -q nocaseglob nocg=$? @@ -65,10 +65,14 @@ $deps" # Source them all in the right order. sourced= for i in $deps; do - [ -e "$profile_d/$i" ] || continue - [ "${sourced/ $i /}" = "$sourced" ] || continue - . "$profile_d/$i" - sourced="$sourced $i " + for j in $profile_d/{,*/}$i; do + [ -e "$j" ] || continue + k="${j##$profile_d/}" + [ "${sourced/ $k /}" = "$sourced" ] || continue + . "$j" + sourced="$sourced $k " + break + done done # Maybe turn nocaseglob back on. @@ -79,7 +83,7 @@ $deps" # Reset LC_ALL. LC_ALL=$lc_all - unset i d n dep deps profile_d path required unsorted sourced + unset i j k d n dep deps profile_d path required unsorted sourced unset lc_all nullglob nocg # Don't inherit failure from the last script.