readarray -d is not supported in bash 4, this should either be fixed or a warning should be added.
readarray -d