aboutsummaryrefslogtreecommitdiff
path: root/bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2013-09-14 18:53:27 +1200
committerTom Ryder <tom@sanctum.geek.nz>2013-09-14 18:53:27 +1200
commit76c3f129d7c8c15aa58c0dda72dc567fe5cb6393 (patch)
treee20ed4d41310347c654489be472cdd14a7622232 /bash
parentDon't limit history if using Bash >=4.3 (diff)
downloaddotfiles-76c3f129d7c8c15aa58c0dda72dc567fe5cb6393.tar.gz
dotfiles-76c3f129d7c8c15aa58c0dda72dc567fe5cb6393.zip
Safeguards to bail if Bash is just too old
Diffstat (limited to 'bash')
-rw-r--r--bash/bash_profile5
-rw-r--r--bash/bashrc5
2 files changed, 10 insertions, 0 deletions
diff --git a/bash/bash_profile b/bash/bash_profile
index c119ddba..e23ec458 100644
--- a/bash/bash_profile
+++ b/bash/bash_profile
@@ -1,3 +1,8 @@
+# Give up completely if no BASH_VERSINFO (<2.0)
+if [ -z "$BASH_VERSINFO" ]; then
+ return
+fi
+
# Source Bourne shell profile if it exists
if [[ -r $HOME/.profile ]]; then
source "$HOME"/.profile
diff --git a/bash/bashrc b/bash/bashrc
index 8951a2ee..87046856 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -1,3 +1,8 @@
+# Give up completely if no BASH_VERSINFO (<2.0)
+if [ -z "$BASH_VERSINFO" ]; then
+ return
+fi
+
# Don't do anything if not running interactively
if [[ $- != *i* ]]; then
return