aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bash/bashrc1
-rwxr-xr-xbin/han10
2 files changed, 9 insertions, 2 deletions
diff --git a/bash/bashrc b/bash/bashrc
index d2562749..f5ca7c11 100644
--- a/bash/bashrc
+++ b/bash/bashrc
@@ -7,6 +7,7 @@ esac
# 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).
+# shellcheck disable=SC2128
[ -n "$BASH_VERSINFO" ] || return
((BASH_VERSINFO[0] == 2)) &&
((10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) &&
diff --git a/bin/han b/bin/han
index 0f081890..20aed9c9 100755
--- a/bin/han
+++ b/bin/han
@@ -2,8 +2,14 @@
# Abstract calls to Bash help vs man(1)
self=han
-# Give up completely if no BASH_VERSINFO (<2.0)
-[ -n "$BASH_VERSINFO" ] || exit
+# 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).
+# shellcheck disable=SC2128
+[ -n "$BASH_VERSINFO" ] || return
+((BASH_VERSINFO[0] == 2)) &&
+ ((10#${BASH_VERSINFO[1]%%[![:digit:]]*} < 5)) &&
+ return
# Figure out the options with which we can call help; Bash >=4.0 has an -m
# option which prints the help output in a man-page like format