diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2023-10-19 15:58:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-19 15:58:20 (GMT) |
commit | 8c69566da66e9239bbcd84b10e60068ade6c1784 (patch) | |
tree | a4124559b5ec89da8fa78d4aba607f99e2616fae /utils | |
parent | c4a146efc40c66de7d06a387465c9f7ea9b2e280 (diff) | |
download | hdf5-8c69566da66e9239bbcd84b10e60068ade6c1784.zip hdf5-8c69566da66e9239bbcd84b10e60068ade6c1784.tar.gz hdf5-8c69566da66e9239bbcd84b10e60068ade6c1784.tar.bz2 |
provide an alternative to mapfile for older bash (#3717)
Diffstat (limited to 'utils')
-rwxr-xr-x | utils/subfiling_vfd/h5fuse.sh.in | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/subfiling_vfd/h5fuse.sh.in b/utils/subfiling_vfd/h5fuse.sh.in index 82d497e..6f4bf61 100755 --- a/utils/subfiling_vfd/h5fuse.sh.in +++ b/utils/subfiling_vfd/h5fuse.sh.in @@ -243,9 +243,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 |