Let's say you have the following input file
Some text. It may contain line
breaks.
Some other part of the text
Yet an other part of
the text
And you want to iterate each text part (seperated by two line breaks (\n\n)), so that
in the first iteration I would only get:
Some text. It may contain line
breaks.
In the second iteration I would get:
Some other part of the text
And in the last iteration I would get:
Yet an other part of
the text
I tried this, but it doesn't seem to work because IFS only supports one character?
cat $inputfile | while IFS=$'\n\n' read part; do
# do something with $part
done