aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-08-16 21:06:42 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-08-16 21:06:42 +1200
commit2d14d81e82c12e8d4d52604e9aa9faf917ecb3d9 (patch)
tree2ab5131ef743ff4ac61c1a88fb6ac83d097f1658
parentRemove some cruft from apf(1) (diff)
downloaddotfiles-2d14d81e82c12e8d4d52604e9aa9faf917ecb3d9.tar.gz
dotfiles-2d14d81e82c12e8d4d52604e9aa9faf917ecb3d9.zip
Use regular BASH_VERSINFO check
-rwxr-xr-xbin/apf3
-rwxr-xr-xbin/edda3
-rwxr-xr-xbin/eds3
-rwxr-xr-xbin/han4
4 files changed, 10 insertions, 3 deletions
diff --git a/bin/apf b/bin/apf
index 2aa1cecd..733d67fc 100755
--- a/bin/apf
+++ b/bin/apf
@@ -2,6 +2,9 @@
# Prepend arguments from a file to a command call
self=apf
+# Give up completely if no BASH_VERSINFO (<2.0)
+[ -n "$BASH_VERSINFO" ] || exit
+
# Require at least two arguments, give usage otherwise
if (($# < 2)) ; then
printf >&2 '%s: Need an arguments file and a command\n' "$self"
diff --git a/bin/edda b/bin/edda
index 0f242c58..589352be 100755
--- a/bin/edda
+++ b/bin/edda
@@ -2,6 +2,9 @@
# Run ed(1) over multiple files, duplicating stdin.
self=edda
+# Give up completely if no BASH_VERSINFO (<2.0)
+[ -n "$BASH_VERSINFO" ] || exit
+
# Define usage function
usage() {
printf 'USAGE: %s [OPTS] [--] FILE1 [FILE2...]\n' "$self"
diff --git a/bin/eds b/bin/eds
index 06686810..eda00174 100755
--- a/bin/eds
+++ b/bin/eds
@@ -2,6 +2,9 @@
# Create and edit executable scripts in a directory EDSPATH (defaults to ~/.local/bin)
self=eds
+# Give up completely if no BASH_VERSINFO (<2.0)
+[ -n "$BASH_VERSINFO" ] || exit
+
# Define a function to show usage
usage() {
printf 'USAGE: %s [EDITOR_OPTS] [--] FILE1 [FILE2...]\n' \
diff --git a/bin/han b/bin/han
index 7c495d2b..5aa4a8b5 100755
--- a/bin/han
+++ b/bin/han
@@ -3,9 +3,7 @@
self=han
# Give up completely if no BASH_VERSINFO (<2.0)
-if ! [ -n "$BASH_VERSINFO" ] ; then
- exit
-fi
+[ -n "$BASH_VERSINFO" ] || exit
# 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.