This mostly stems form `readarray` not being available on MacOS bash. Any suggestions for workarounds to this?