aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-09-18 01:33:02 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-09-18 01:33:02 +1200
commit2c6040d416792ca8c57ffbf5397b3aca5800a49d (patch)
tree16be81ba2fd7ad3eaf1ebe0a51f37e36c54fa7fc /bash
parentFix comment in xgo(1df) (diff)
downloaddotfiles-2c6040d416792ca8c57ffbf5397b3aca5800a49d.tar.gz
dotfiles-2c6040d416792ca8c57ffbf5397b3aca5800a49d.zip
Source $ENV even if running ancient Bash
Diffstat (limited to 'bash')
-rw-r--r--bash/bashrc8
1 files changed, 6 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc
index a48a9081..1c7d7802 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -4,6 +4,10 @@ case $- in
*) return ;;
esac
+# If ENV is set, source it to get all the POSIX-compatible interactive stuff;
+# we should be able to do this even if we're running a truly ancient Bash
+[ -n "$ENV" ] && . "$ENV"
+
# Ensure we're using at least version 2.05. Weird arithmetic syntax needed here
# due to leading zeroes and trailing letters in some 2.x version numbers (e.g.
# 2.05a).
@@ -82,8 +86,8 @@ if ((BASH_VERSINFO[0] >= 4)) ; then
((BASH_VERSINFO[1] >= 3)) && shopt -s direxpand
fi
-# Load POSIX shell startup files and then Bash-specific ones
-for sh in "$ENV" "$HOME"/.bashrc.d/*.bash ; do
+# Load Bash-specific startup files
+for sh in "$HOME"/.bashrc.d/*.bash ; do
[[ -e $sh ]] && source "$sh"
done
unset -v sh