aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
Diffstat (limited to 'commands')
-rw-r--r--commands/help.sh20
1 files changed, 16 insertions, 4 deletions
diff --git a/commands/help.sh b/commands/help.sh
index 7da4d5f..309b7df 100644
--- a/commands/help.sh
+++ b/commands/help.sh
@@ -1,7 +1,7 @@
#!/bin/sh
# help.sh -- "dejagnu help" command
#
-# Copyright (C) 2018 Free Software Foundation, Inc.
+# Copyright (C) 2018, 2021 Free Software Foundation, Inc.
#
# This file is part of DejaGnu.
#
@@ -26,6 +26,18 @@
# # -W Passed to man(1)
# ##end
+# shellcheck disable=SC2003
+# The shellcheck tool complains about use of expr and recommends using
+# newer shell features instead. Solaris 10 /bin/sh does not support the
+# newer features, so we must use expr in this script.
+
+# shellcheck disable=SC2006
+# The shellcheck tool complains about the old style backtick command
+# substitution. Solaris 10 /bin/sh does not support the new style $()
+# command substitution and the usage of command substitution in this script
+# is simple enough to work. Most notably, nesting backtick command
+# substitution is tricky, but we do not do that.
+
# This script was written by Jacob Bachmeyer.
args=
@@ -33,7 +45,7 @@ command=dejagnu
verbose=0
for a in "$@"; do
case $a in
- -v|--v|-verb*|--verb*) verbose=$((verbose + 1)) ;;
+ -v|--v|-verb*|--verb*) verbose=`expr $verbose + 1` ;;
-w|-W|--path) args="${args} ${a}" ;;
-*) echo Unrecognized option "\"$a\"" ;;
*) command="${command}-${a}" ;;
@@ -45,8 +57,8 @@ if expr "$verbose" \> 0 > /dev/null ; then
fi
## Get the location of this script and check for nearby "doc" dir.
-commdir="$(echo "$0" | sed -e 's@/[^/]*$@@')"
-docdir="$(echo "$commdir" | sed -e 's@/[^/]*$@@')/doc"
+commdir=`echo "$0" | sed -e 's@/[^/]*$@@'`
+docdir=`echo "$commdir" | sed -e 's@/[^/]*$@@'`/doc
if expr "$verbose" \> 0 > /dev/null ; then
echo Running from "$commdir"