From c919593f06e48ab637dd1654535a98c4353d25be Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 22 Feb 2024 15:21:31 -0500 Subject: [PATCH] BF: replace use of mapfile with a while loop Solution provided by chatgpt. The reason is that OSX has elderly bash 3.2.57 (due to licensing issue) which has no mapfile. On Debian I have 5.2.21 now --- scripts/singularity_cmd | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/singularity_cmd b/scripts/singularity_cmd index 7d47c9bc..da4e47f6 100755 --- a/scripts/singularity_cmd +++ b/scripts/singularity_cmd @@ -51,7 +51,12 @@ function pass_git_config() { VALUES=( "$2" ) else # read all values into an array - mapfile -t VALUES < <(git config --get-all "$var") + # There is no mapfile on OSX, so can't do + # mapfile -t VALUES < <(git config --get-all "$var") + VALUES=() + while IFS= read -r line; do + VALUES+=("$line") + done < <(git config --get-all "$var") fi for value in "${VALUES[@]}"; do