aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bash_logout8
-rw-r--r--bash/bash_profile8
-rw-r--r--bash/bashrc18
3 files changed, 19 insertions, 15 deletions
diff --git a/bash/bash_logout b/bash/bash_logout
index ae6ab015..e5855f36 100644
--- a/bash/bash_logout
+++ b/bash/bash_logout
@@ -1,8 +1,10 @@
-# Ensure we're using at least version 2.05
+# 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).
if ! [ -n "$BASH_VERSINFO" ] ; then
return
-elif ((BASH_VERSINFO[0] == 2)) && \
- ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then
+elif ((BASH_VERSINFO[0] == 2 && \
+ 10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then
return
fi
diff --git a/bash/bash_profile b/bash/bash_profile
index 1269492e..e8762fd2 100644
--- a/bash/bash_profile
+++ b/bash/bash_profile
@@ -3,11 +3,13 @@ if [ -e "$HOME"/.profile ] ; then
. "$HOME"/.profile
fi
-# Ensure we're using at least version 2.05
+# 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).
if ! [ -n "$BASH_VERSINFO" ] ; then
return
-elif ((BASH_VERSINFO[0] == 2)) && \
- ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then
+elif ((BASH_VERSINFO[0] == 2 && \
+ 10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then
return
fi
diff --git a/bash/bashrc b/bash/bashrc
index a80d827d..2de3f6f4 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -1,8 +1,10 @@
-# Ensure we're using at least version 2.05
+# 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).
if ! [ -n "$BASH_VERSINFO" ] ; then
return
-elif ((BASH_VERSINFO[0] == 2)) && \
- ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then
+elif ((BASH_VERSINFO[0] == 2 && \
+ 10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) ; then
return
fi
@@ -77,7 +79,7 @@ shopt -s shift_verbose
shopt -u sourcepath
# These options only exist since Bash 4.0-alpha
-if ((BASH_VERSINFO[0] >= 4)) ; then
+if ((BASH_VERSINFO[0] == 4)) ; then
# Autocorrect fudged paths during completion
shopt -s dirspell
@@ -86,14 +88,12 @@ if ((BASH_VERSINFO[0] >= 4)) ; then
# Warn me about stopped jobs when exiting; only if >=4.1 due to bug
# <https://lists.gnu.org/archive/html/bug-bash/2009-02/msg00176.html>
- if ((BASH_VERSINFO[0] > 4)) || \
- ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} >= 1)) ; then
+ if ((BASH_VERSINFO[1] >= 1)) ; then
shopt -s checkjobs
fi
- # Expand variables in directory completion
- if ((BASH_VERSINFO[0] > 4)) || \
- ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} >= 3)) ; then
+ # Expand variables in directory completion; only available since 4.3
+ if ((BASH_VERSINFO[1] >= 3)) ; then
shopt -s direxpand
fi
fi