diff --git a/bin/all-run.sh b/bin/all-run.sh index d0e9ee288..8525d1e22 100755 --- a/bin/all-run.sh +++ b/bin/all-run.sh @@ -55,18 +55,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -152,7 +185,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/all-years.sh b/bin/all-years.sh index c1aebab7f..9869e7946 100755 --- a/bin/all-years.sh +++ b/bin/all-years.sh @@ -54,18 +54,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -152,7 +185,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/chk-entry.sh b/bin/chk-entry.sh index a6b791408..239382708 100755 --- a/bin/chk-entry.sh +++ b/bin/chk-entry.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -94,7 +127,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/gen-authors.sh b/bin/gen-authors.sh index df25a544b..1f1dbaa88 100755 --- a/bin/gen-authors.sh +++ b/bin/gen-authors.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -152,7 +185,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/gen-location.sh b/bin/gen-location.sh index 8426413f4..920f71e05 100755 --- a/bin/gen-location.sh +++ b/bin/gen-location.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -121,7 +154,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/gen-other-html.sh b/bin/gen-other-html.sh index e4aafe2c7..f3e317e37 100755 --- a/bin/gen-other-html.sh +++ b/bin/gen-other-html.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -119,7 +152,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/gen-sitemap.sh b/bin/gen-sitemap.sh index 775960cfe..ecf65f1a7 100755 --- a/bin/gen-sitemap.sh +++ b/bin/gen-sitemap.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -172,7 +205,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/gen-status.sh b/bin/gen-status.sh index 59073f219..fcf78a1c0 100755 --- a/bin/gen-status.sh +++ b/bin/gen-status.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -131,7 +164,7 @@ Exit codes: 1 some file is not found, not a readable file or is malformed 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory >= 10 internal error diff --git a/bin/gen-top-html.sh b/bin/gen-top-html.sh index ae81da3fa..bedcfb574 100755 --- a/bin/gen-top-html.sh +++ b/bin/gen-top-html.sh @@ -30,18 +30,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -140,7 +173,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 8 markdown file(s) not a non-empty readable file diff --git a/bin/gen-year-index.sh b/bin/gen-year-index.sh index 03c9b45db..569e09954 100755 --- a/bin/gen-year-index.sh +++ b/bin/gen-year-index.sh @@ -28,18 +28,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -108,7 +141,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/gen-years.sh b/bin/gen-years.sh index 4cc22c66a..c0b310898 100755 --- a/bin/gen-years.sh +++ b/bin/gen-years.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -133,7 +166,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/md2html.sh b/bin/md2html.sh index 2560b0b92..49d213743 100755 --- a/bin/md2html.sh +++ b/bin/md2html.sh @@ -78,18 +78,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -203,7 +236,7 @@ Exit codes: 0 all OK 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/output-index-author.sh b/bin/output-index-author.sh index 1ce4bd9ef..aea3d11e1 100755 --- a/bin/output-index-author.sh +++ b/bin/output-index-author.sh @@ -32,18 +32,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -109,7 +142,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/output-index-inventory.sh b/bin/output-index-inventory.sh index a0ea9b17e..3391f699f 100755 --- a/bin/output-index-inventory.sh +++ b/bin/output-index-inventory.sh @@ -32,18 +32,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expand to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -109,7 +142,7 @@ Exit codes: 1 pandoc exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 YYYY/dir is not a entry directory 6 pandoc tool not found or not executable >= 10 internal error diff --git a/bin/output-year-index.sh b/bin/output-year-index.sh index 96304a376..27e35d3e0 100755 --- a/bin/output-year-index.sh +++ b/bin/output-year-index.sh @@ -33,18 +33,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -109,7 +142,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/pandoc-wrapper.sh b/bin/pandoc-wrapper.sh index 36d784f3a..53ef3537d 100755 --- a/bin/pandoc-wrapper.sh +++ b/bin/pandoc-wrapper.sh @@ -33,18 +33,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -118,7 +151,7 @@ Exit codes: 1 pandoc exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory >= 10 internal error diff --git a/bin/quick-readme2index.sh b/bin/quick-readme2index.sh index 51b67a124..505ec587c 100755 --- a/bin/quick-readme2index.sh +++ b/bin/quick-readme2index.sh @@ -35,18 +35,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -138,7 +171,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/readme2index.sh b/bin/readme2index.sh index e1a17ce97..d6c82b859 100755 --- a/bin/readme2index.sh +++ b/bin/readme2index.sh @@ -29,18 +29,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -129,7 +162,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/sort.gitignore.sh b/bin/sort.gitignore.sh index 89f2b1a46..bb1ff54c1 100755 --- a/bin/sort.gitignore.sh +++ b/bin/sort.gitignore.sh @@ -41,18 +41,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -104,7 +137,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/status2html.sh b/bin/status2html.sh index e2a778c5e..ecfd06da2 100755 --- a/bin/status2html.sh +++ b/bin/status2html.sh @@ -30,18 +30,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -104,7 +137,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/subst.default.sh b/bin/subst.default.sh index 03970cd52..a44f66bc9 100755 --- a/bin/subst.default.sh +++ b/bin/subst.default.sh @@ -35,18 +35,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -109,7 +142,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file >= 10 internal error diff --git a/bin/subst.entry-index.sh b/bin/subst.entry-index.sh index 217c5d1d5..a5ab0100d 100755 --- a/bin/subst.entry-index.sh +++ b/bin/subst.entry-index.sh @@ -35,18 +35,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -108,7 +141,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/subst.year-index.sh b/bin/subst.year-index.sh index af9ca2cde..e68725866 100755 --- a/bin/subst.year-index.sh +++ b/bin/subst.year-index.sh @@ -35,18 +35,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -108,7 +141,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/tar-all.sh b/bin/tar-all.sh index 05a01936c..244a29c13 100755 --- a/bin/tar-all.sh +++ b/bin/tar-all.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -100,7 +133,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/tar-entry.sh b/bin/tar-entry.sh index d71b1afb4..8465c2d0b 100755 --- a/bin/tar-entry.sh +++ b/bin/tar-entry.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -103,7 +136,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory diff --git a/bin/tar-year.sh b/bin/tar-year.sh index 6f74a7f51..782cbcfef 100755 --- a/bin/tar-year.sh +++ b/bin/tar-year.sh @@ -26,18 +26,51 @@ # # Share and enjoy! :-) -# firewall - must be bash with a version 4.2 or later +# firewall - run only with a bash that is version 5.1.8 or later # -# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# The "/usr/bin/env bash" command must result in using a bash that +# is version 5.1.8 or later. # -if [[ -z ${BASH_VERSINFO[0]} || ${BASH_VERSINFO[0]} -lt 4 || ${BASH_VERSINFO[0]} -eq 4 && ${BASH_VERSINFO[1]} -lt 2 ]]; then - echo "$0: ERROR: bash version must be >= 4.2: $BASH_VERSION" 1>&2 +# We could relax this version and insist on version 4.2 or later. Versions +# of bash between 4.2 and 5.1.7 might work. However, to be safe, we will require +# bash version 5.1.8 or later. +# +# WHY 5.1.8 and not 4.2? This safely is done because macOS homebrew bash we +# often use it "version 5.2.26(1)-release" or later, and the RHEL Linux bash we +# use often use is "version 5.1.8(1)-release" or later. These versions are what +# we initially tested. We recommend you either upgrade bash or install a newer +# version of bash and adjust your $PATH so that "/usr/bin/env bash" finds a basj +# that is version 5.1.8 or later. +# +# NOTE: The macOS shipped, as of 2024 March 15, a version of bash is something like +# bash "version 3.2.57(1)-release". That macOS shipped version of bash +# will NOT work. For users of macOS we recommend you install homebrew, +# (see https://brew.sh), and then install homebrew bash (/opt/homebrew/bin/bash), +# and then arrange your $PATH so that "/opt/homebrew/bin" is ahead of "/bin". +# +# NOTE: And while macports might work, we noticed a number of subtle differences +# with some of their ported tools to suggest you might be better off +# with installing homebrew (see https://brew.sh). No disrespect is intended +# to the macports team as they do a commendable job. Nevertheless we ran +# into enough differences with macports environments to suggest you +# might find a better experience with this tool under homebrew instead. +# +if [[ -z ${BASH_VERSINFO[0]} || + ${BASH_VERSINFO[0]} -lt 5 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -lt 1 || + ${BASH_VERSINFO[0]} -eq 5 && ${BASH_VERSINFO[1]} -eq 1 && ${BASH_VERSINFO[1]} -lt 8 ]]; then + echo "$0: ERROR: bash version needs to be >= 5.1.8: $BASH_VERSION" 1>&2 + echo "$0: Warning: bash version >= 4.2 might work but 5.1.8 was the minimum we tested" 1>&2 + echo "$0: Notice: For macOS users, install homebrew (see https://brew.sh)," \ + "then install homebrew bash (usually in /opt/homebrew/bin/bash)," \ + "and then arrange \$PATH so that /opt/homebrew/bin is ahead of /bin" 1>&2 exit 4 fi # setup bash file matching # -# Requires bash with a version 4.2 or later +# We must declare arrays with -ag or -Ag, and we need loops to "export" modified variables. +# This requires a bash with a version 4.2 or later. See the larger comment above about bash versions. # shopt -s nullglob # enable expanded to nothing rather than remaining unexpanded shopt -u failglob # disable error message if no matches are found @@ -103,7 +136,7 @@ Exit codes: 1 some internal tool exited non-zero 2 -h and help string printed or -V and version string printed 3 command line error - 4 bash version is < 4.2 + 4 bash version is too old 5 some internal tool is not found or not an executable file 6 problems found with or in the topdir or topdir/YYYY directory 7 problems found with or in the entry topdir/YYYY/dir directory