I have either a file (or the output of a command) that has block of lines separated by the empty line - like below:
1
2
3
4
5
6
cannot figure out how to populate bash (4.4.12) array with "block" of lines for each array cell, e.g.
arr[0]='
1
2
3'
array[1]='
4
5
6'
Looked around for similar threads with readarray
, mapfile
, played with IFS/read
and other alternatives, but cannot figure out how to do the "blocks" of lines, not simply one-line-at-the time.
What's the magic combo?