I have been using the pattern below for printing multiline messages to terminal in a bash script.  read -d '' message <<- EOF    this is a     mulitline    messageEOFecho $messageThis has been working - until a couple of days ago the pattern just stopped working. By stopped working, I mean when bash encountered these heredoc expressions in the script - it just seems to do nothing -  no output.The only thing that I can think of thats changed in the last few days is that the environment the scripts are run inside is a Ubuntu 14.04 live USB, versus full installs.Then I discovered that when I move the heredoc before the scripts set -o errexit statement it started working again. i.e. this doesn't work#!/bin/bashset -o errexitread -d '' message <<- EOF    this is a     mulitline    messageEOFecho $messageresult: (nothing)But this does work#!/bin/bashread -d '' message <<- EOF    this is a     mulitline    messageEOFecho $messageresult$ sudo ./script.sh this is a mulitlinemessagebash --version - GNU bash, version 4.3.11(1)-release (i686-pc-linux-gnu)
Why is set-o errexit breaking this read/heredoc expression?
bash
read returns a non-zero exit status if it doesn't find a delimiter, which is always the case when the delimiter is an empty string.