From 4e90f2d2385442701fb5b71e50ec486db1365d38 Mon Sep 17 00:00:00 2001 From: Zoltan Somogyi Date: Mon, 2 Oct 2023 15:02:53 +1100 Subject: [PATCH] Update the programming style of yet more scripts. --- scripts/canonical_grade.in | 8 ++++---- scripts/mdprof.in | 4 ++-- scripts/mkfifo_using_mknod.in | 4 ++-- scripts/mprof.in | 10 +++++++--- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/canonical_grade.in b/scripts/canonical_grade.in index 135fd3318..035f360d1 100644 --- a/scripts/canonical_grade.in +++ b/scripts/canonical_grade.in @@ -21,7 +21,7 @@ usage="Usage: canonical_grade --grade " -while : +while true do case "$1" in # include the file `parse_grade_options.sh-subr' @@ -38,9 +38,9 @@ do shift done -if test $# -ne 0 +if test "$#" -ne 0 then - echo "$usage" + echo "${usage}" exit 1 fi @@ -50,5 +50,5 @@ fi # include the file `canonical_grade.sh-subr' @CANONICAL_GRADE@ -echo $GRADE +echo ${GRADE} exit 0 diff --git a/scripts/mdprof.in b/scripts/mdprof.in index 99f5d8499..36526eb95 100644 --- a/scripts/mdprof.in +++ b/scripts/mdprof.in @@ -20,7 +20,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ -PATH=@bindir@:$PATH +PATH=@bindir@:${PATH} export PATH # Use less heap at the expense of increased time spent in the GC. @@ -28,7 +28,7 @@ export PATH if false then MERCURY_OPTIONS_mdprof_cgi="--boehm-gc-free-space-divisor 10 \ - ${MERCURY_OPTIONS_mdprof_cgi}" + ${MERCURY_OPTIONS_mdprof_cgi}" export MERCURY_OPTIONS_mdprof_cgi fi diff --git a/scripts/mkfifo_using_mknod.in b/scripts/mkfifo_using_mknod.in index fe9456b16..5ab16d03c 100755 --- a/scripts/mkfifo_using_mknod.in +++ b/scripts/mkfifo_using_mknod.in @@ -16,9 +16,9 @@ # ENVIRONMENT VARIABLES: MERCURY_MKNOD MKNOD=${MERCURY_MKNOD=@MKNOD@} -if test $# -ne 1 +if test "$#" -ne 1 then echo "Usage: `basename $0` filename" 1>&2 exit 1 fi -exec $MKNOD "$1" p +exec ${MKNOD} "$1" p diff --git a/scripts/mprof.in b/scripts/mprof.in index d9cf8b09e..6269804da 100644 --- a/scripts/mprof.in +++ b/scripts/mprof.in @@ -19,7 +19,11 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ MPROF=${MERCURY_PROFILER="@bindir@/mercury_profile"} -case $# in - 0) exec $MPROF ;; - *) exec $MPROF "$@" ;; +case "$#" in + 0) + exec ${MPROF} + ;; + *) + exec ${MPROF} "$@" + ;; esac