A discussion¹ of an earlier related post² from the same author brings up a lot of the
— sometimes subtle — problems with relying on here documents/strings in shell scripts.
¹ https://news.ycombinator.com/item?id=29845232
² https://utcc.utoronto.ca/~cks/space/blog/unix/ProcessSubstit...