aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorJacob Bachmeyer <jcb@gnu.org>2021-03-26 23:04:15 -0500
committerJacob Bachmeyer <jcb@gnu.org>2021-03-26 23:04:15 -0500
commita8a331ee5b0953ee3ca11764e4a6e4f2af8722c9 (patch)
tree6afa3ab9be4488de2ec69a75cece99ad61d3fa96 /commands
parented6511a32895f6af1451adcdd42815adcde7341a (diff)
downloaddejagnu-a8a331ee5b0953ee3ca11764e4a6e4f2af8722c9.zip
dejagnu-a8a331ee5b0953ee3ca11764e4a6e4f2af8722c9.tar.gz
dejagnu-a8a331ee5b0953ee3ca11764e4a6e4f2af8722c9.tar.bz2
Address PR47386
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"