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.
This commit is contained in:
Landon Curt Noll committed 2024-07-22 12:23:33 -07:00
1 parent 7747230c58
commit 354953b530
7 files changed
+34 -34

No files matched your search

+13 -13
View File
@@ -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