From 354953b5308d9c4c9b6af7f242478300a12fb839 Mon Sep 17 00:00:00 2001 From: Landon Curt Noll Date: Mon, 22 Jul 2024 12:23:33 -0700 Subject: [PATCH] fix checking of command status In the spirit of pr #2589, we correct similar cases where the string "status" instead of `$status` was being tested for a value. In `bin/csv2entry.sh` changed VERSION from "1.1 2024-07-20" to "1.1.1 2024-07-22". In `bin/entry2csv.sh` changed VERSION from "1.1 2024-07-20" to "1.1.1 2024-07-22". In `bin/gen-sitemap.sh` changed VERSION from "1.3.10 2024-07-18" to "1.3.11 2024-07-22". In `bin/gen-status.sh` changed VERSION from "1.5.5 2024-07-18" to "1.5.6 2024-07-22". In `bin/md2html.sh` changed VERSION from "1.5.2 2024-07-18" to "1.5.3 2024-07-22". In `bin/tar-entry.sh` changed VERSION from "1.3.6 2024-04-28" to "1.3.7 2024-07-22". In `bin/tar-year.sh` changed VERSION from "1.2.4 2024-04-28" to "1.2.5 2024-07-22". Performed `make www` to accomplish the above and to test under macOS. --- bin/csv2entry.sh | 26 +++++++++++++------------- bin/entry2csv.sh | 20 ++++++++++---------- bin/gen-sitemap.sh | 4 ++-- bin/gen-status.sh | 6 +++--- bin/md2html.sh | 4 ++-- bin/tar-entry.sh | 4 ++-- bin/tar-year.sh | 4 ++-- 7 files changed, 34 insertions(+), 34 deletions(-) diff --git a/bin/csv2entry.sh b/bin/csv2entry.sh index 1f5f947ac..979d6d023 100755 --- a/bin/csv2entry.sh +++ b/bin/csv2entry.sh @@ -142,7 +142,7 @@ shopt -s lastpipe # explicitly run the last command of the pipe line in the curr # set variables referenced in the usage message # -export VERSION="1.1 2024-07-20" +export VERSION="1.1.1 2024-07-22" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -705,7 +705,7 @@ if [[ -z $NOOP ]]; then fi canonicalize_csv "$AUTHOR_WINS_CSV" "$TMP_AUTHOR_WINS_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: canonicalize_csv $AUTHOR_WINS_CSV $TMP_AUTHOR_WINS_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -727,7 +727,7 @@ if [[ -z $NOOP ]]; then fi sort -t, -k1d,1 -k2d,2 "$TMP_AUTHOR_WINS_CSV" -o "$TMP_AUTHOR_WINS_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort -t, -k1d,1 -k2d,2 $TMP_AUTHOR_WINS_CSV -o $TMP_AUTHOR_WINS_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -765,7 +765,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_AUTHOR_WINS_CSV" "$AUTHOR_WINS_CSV" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_AUTHOR_WINS_CSV $AUTHOR_WINS_CSV filed," \ "error code: $status" 1>&2 exit 8 @@ -917,7 +917,7 @@ if [[ $V_FLAG -ge 5 ]]; then fi sort "$TMP_AUTHOR_HANDLE_INVENTORY" -o "$TMP_AUTHOR_HANDLE_INVENTORY" status="$?" -if [[ status -ne 0 ]]; then +if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort $TMP_AUTHOR_HANDLE_INVENTORY -o $TMP_AUTHOR_HANDLE_INVENTORY failed," \ "error code: $status" 1>&2 exit 9 @@ -947,7 +947,7 @@ if [[ -z $NOOP ]]; then fi canonicalize_csv "$MANIFEST_CSV" "$TMP_MANIFEST_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: canonicalize_csv $MANIFEST_CSV $TMP_MANIFEST_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -969,7 +969,7 @@ if [[ -z $NOOP ]]; then fi sort -t, -k1,1 -k2d,2 -k4n,4 -k3,3 -k5d,8 "$TMP_MANIFEST_CSV" -o "$TMP_MANIFEST_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort -t, -k1,1 -k2d,2 -k4n,4 -k3,3 -k5d,8 $TMP_MANIFEST_CSV -o $TMP_MANIFEST_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -1007,7 +1007,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_MANIFEST_CSV" "$MANIFEST_CSV" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_MANIFEST_CSV $MANIFEST_CSV filed," \ "error code: $status" 1>&2 exit 8 @@ -1034,7 +1034,7 @@ if [[ -z $NOOP ]]; then fi canonicalize_csv "$YEAR_PRIZE_CSV" "$TMP_YEAR_PRIZE_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: canonicalize_csv $YEAR_PRIZE_CSV $TMP_YEAR_PRIZE_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -1056,7 +1056,7 @@ if [[ -z $NOOP ]]; then fi sort -t, -k1d,1 -k2d,2 "$TMP_YEAR_PRIZE_CSV" -o "$TMP_YEAR_PRIZE_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort -t, -k1d,1 -k2d,2 $TMP_YEAR_PRIZE_CSV -o $TMP_YEAR_PRIZE_CSV," \ "error code: $status" 1>&2 exit 8 @@ -1094,7 +1094,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_YEAR_PRIZE_CSV" "$YEAR_PRIZE_CSV" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_YEAR_PRIZE_CSV $YEAR_PRIZE_CSV filed," \ "error code: $status" 1>&2 exit 8 @@ -1293,7 +1293,7 @@ if [[ $V_FLAG -ge 5 ]]; then fi sort -t/ -d "$TMP_YYYY_DIR_INV" -o "$TMP_YYYY_DIR_INV" status="$?" -if [[ status -ne 0 ]]; then +if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort -t/ -d $TMP_YYYY_DIR_INV -o $TMP_YYYY_DIR_INV failed," \ "error code: $status" 1>&2 exit 8 @@ -1502,7 +1502,7 @@ sed -e '/^#/d' -e 's/,/ /g' "$MANIFEST_CSV" | mv -f -- "$TMP_ENTRY_JSON" "$PREV_ENTRY_JSON" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_ENTRY_JSON $PREV_ENTRY_JSON filed," \ "error code: $status" 1>&2 exit 1 diff --git a/bin/entry2csv.sh b/bin/entry2csv.sh index 9126310af..b29223b54 100755 --- a/bin/entry2csv.sh +++ b/bin/entry2csv.sh @@ -118,7 +118,7 @@ shopt -s lastpipe # explicitly run the last command of the pipe line in the curr # set variables referenced in the usage message # -export VERSION="1.1 2024-07-20" +export VERSION="1.1.1 2024-07-22" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -926,7 +926,7 @@ for YYYY in $(< "$TOP_FILE"); do if [[ -z $NOOP ]]; then awk -f "$MANIFEST_ENTRY_CSV_ENTRY_AWK" "$ENTRY_JSON" >> "$TMP_MANIFEST_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: awk -f $MANIFEST_ENTRY_CSV_ENTRY_AWK $ENTRY_JSON >> $TMP_MANIFEST_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -959,7 +959,7 @@ if [[ -z $NOOP ]]; then fi sort "$TMP_AUTHOR_WIN" -o "$TMP_AUTHOR_WIN" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort $TMP_AUTHOR_WIN -o $TMP_AUTHOR_WIN failed," \ "error code: $status" 1>&2 exit 8 @@ -1028,7 +1028,7 @@ if [[ -z $NOOP ]]; then fi sort -t, -k1d,1 -k2d,2 "$TMP_AUTHOR_WINS_CSV" -o "$TMP_AUTHOR_WINS_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort -t, -k1d,1 -k2d,2 $TMP_AUTHOR_WINS_CSV -o $TMP_AUTHOR_WINS_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -1066,7 +1066,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_AUTHOR_WINS_CSV" "$AUTHOR_WINS_CSV" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_AUTHOR_WINS_CSV $AUTHOR_WINS_CSV filed," \ "error code: $status" 1>&2 exit 8 @@ -1218,7 +1218,7 @@ if [[ $V_FLAG -ge 5 ]]; then fi sort "$TMP_AUTHOR_HANDLE_INVENTORY" -o "$TMP_AUTHOR_HANDLE_INVENTORY" status="$?" -if [[ status -ne 0 ]]; then +if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort $TMP_AUTHOR_HANDLE_INVENTORY -o $TMP_AUTHOR_HANDLE_INVENTORY failed," \ "error code: $status" 1>&2 exit 9 @@ -1251,7 +1251,7 @@ if [[ -z $NOOP ]]; then fi sort -t, -k1,1 -k2d,2 -k4n,4 -k3,3 -k5d,8 "$TMP_MANIFEST_CSV" -o "$TMP_MANIFEST_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort -t, -k1,1 -k2d,2 -k4n,4 -k3,3 -k5d,8 $TMP_MANIFEST_CSV -o $TMP_MANIFEST_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -1289,7 +1289,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_MANIFEST_CSV" "$MANIFEST_CSV" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_MANIFEST_CSV $MANIFEST_CSV filed," \ "error code: $status" 1>&2 exit 8 @@ -1319,7 +1319,7 @@ if [[ -z $NOOP ]]; then fi sort -t, -k1d,1 -k2d,2 "$TMP_YEAR_PRIZE_CSV" -o "$TMP_YEAR_PRIZE_CSV" status="$?" - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: sort -t, -k1d,1 -k2d,2 $TMP_YEAR_PRIZE_CSV -o $TMP_YEAR_PRIZE_CSV failed," \ "error code: $status" 1>&2 exit 8 @@ -1357,7 +1357,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_YEAR_PRIZE_CSV" "$YEAR_PRIZE_CSV" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_YEAR_PRIZE_CSV $YEAR_PRIZE_CSV filed," \ "error code: $status" 1>&2 exit 8 diff --git a/bin/gen-sitemap.sh b/bin/gen-sitemap.sh index 38fac6e54..b30884e16 100755 --- a/bin/gen-sitemap.sh +++ b/bin/gen-sitemap.sh @@ -84,7 +84,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an # set variables referenced in the usage message # -export VERSION="1.3.10 2024-07-18" +export VERSION="1.3.11 2024-07-22" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -924,7 +924,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_SITEMAP" "$SITEMAP" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_SITEMAP $SITEMAP filed, error code: $status" 1>&2 EXIT_CODE=8 # exit 8 elif [[ $V_FLAG -ge 1 ]]; then diff --git a/bin/gen-status.sh b/bin/gen-status.sh index 7072fa37a..47b4e318f 100755 --- a/bin/gen-status.sh +++ b/bin/gen-status.sh @@ -84,7 +84,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an # set variables referenced in the usage message # -export VERSION="1.5.5 2024-07-18" +export VERSION="1.5.6 2024-07-22" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -1143,7 +1143,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_RULES_MD" "$RULES_MD" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_RULES_MD $RULES_MD filed, error code: $status" 1>&2 elif [[ $V_FLAG -ge 1 ]]; then echo "$0: debug[1]: built replaced rules.md: $RULES_MD" 1>&2 @@ -1227,7 +1227,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_GUIDELINES_MD" "$GUIDELINES_MD" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_GUIDELINES_MD $GUIDELINES_MD filed, error code: $status" 1>&2 elif [[ $V_FLAG -ge 1 ]]; then echo "$0: debug[1]: built replaced guidelines.md: $GUIDELINES_MD" 1>&2 diff --git a/bin/md2html.sh b/bin/md2html.sh index e8a1e696b..2ac00c398 100755 --- a/bin/md2html.sh +++ b/bin/md2html.sh @@ -141,7 +141,7 @@ shopt -s lastpipe # run last command of a pipeline not executed in the backgroun # set variables referenced in the usage message # -export VERSION="1.5.2 2024-07-18" +export VERSION="1.5.3 2024-07-22" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -2300,7 +2300,7 @@ if [[ -z $NOOP ]]; then mv -f -- "$TMP_INDEX_HTML" "$OUTPUT_HTML" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_INDEX_HTML $OUTPUT_HTML filed, error code: $status" 1>&2 exit 139 elif [[ $V_FLAG -ge 1 ]]; then diff --git a/bin/tar-entry.sh b/bin/tar-entry.sh index 4b987fed2..7ea0a6264 100755 --- a/bin/tar-entry.sh +++ b/bin/tar-entry.sh @@ -83,7 +83,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an # set variables referenced in the usage message # -export VERSION="1.3.6 2024-04-28" +export VERSION="1.3.7 2024-07-22" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -811,7 +811,7 @@ if [[ -n $REBUILD_TARBALL ]]; then mv -f -- "$TMP_TARBALL" "$TARBALL" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_TARBALL $TARBALL filed, error code: $status" 1>&2 exit 8 elif [[ $V_FLAG -ge 1 ]]; then diff --git a/bin/tar-year.sh b/bin/tar-year.sh index 2b4a61bc8..61c2667b9 100755 --- a/bin/tar-year.sh +++ b/bin/tar-year.sh @@ -83,7 +83,7 @@ shopt -s globstar # enable ** to match all files and zero or more directories an # set variables referenced in the usage message # -export VERSION="1.2.4 2024-04-28" +export VERSION="1.2.5 2024-07-22" NAME=$(basename "$0") export NAME export V_FLAG=0 @@ -916,7 +916,7 @@ if [[ -n $REBUILD_TARBALL ]]; then mv -f -- "$TMP_TARBALL" "$TARBALL" status="$?" fi - if [[ status -ne 0 ]]; then + if [[ $status -ne 0 ]]; then echo "$0: ERROR: mv -f -- $TMP_TARBALL $TARBALL filed, error code: $status" 1>&2 exit 8 elif [[ $V_FLAG -ge 1 ]]; then