From c4770f0270cd1e994e45903f68f64154337b84d6 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 19 Oct 2023 00:28:45 -0500 Subject: [PATCH] provide an alternative to mapfile for older bash --- utils/subfiling_vfd/h5fuse.sh.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/utils/subfiling_vfd/h5fuse.sh.in b/utils/subfiling_vfd/h5fuse.sh.in index c6d715fd0a9..360e2741b21 100755 --- a/utils/subfiling_vfd/h5fuse.sh.in +++ b/utils/subfiling_vfd/h5fuse.sh.in @@ -144,9 +144,15 @@ if test -z "$subfile_dir"; then exit $FAILED fi -# For bash 4.4+ subfs=$(sed -e '1,/subfile_dir=/d' "$file_config") -mapfile -t subfiles <<< "$subfs" +if command -v mapfile > /dev/null; then + # For bash 4.4+ + mapfile -t subfiles <<< "$subfs" +else + while IFS= read -r line; do + subfiles+=("$line") + done <<< "$subfs" +fi if [ ${#subfiles[@]} -eq 0 ]; then echo -e "$RED failed to find subfiles list in $file_config $NC" exit $FAILED