builtin-option
Bash mapfile -d
Bash 5.2 verified: empty delimiter means NUL; -t strips the delimiter. Collects data in memory.
Formal Syntax & Structure
bash syntaxbash
mapfile -d '' -t nameReturn Value
exit status
Bash 5.2 verified: empty delimiter means NUL; -t strips the delimiter. Collects data in memory.
Working Example
Example Snippetbash
mapfile -d '' -t names < <(printf '%s\0' 'daily report' $'two\nlines')printf 'count=%s\n' "${#names[@]}"printf '%q\n' "${names[@]}"