bash read returns with exit code 1 even though it runs as expected
<p>I have this construct to initialize a variable with the contents of a file:</p>

<pre><code>echo "yyy" &gt; xxx
read -r -d '' PAYLOAD &lt;&lt;&lt; $(cat xxx)
echo $?
echo $PAYLOAD
</code></pre>

<p>This results in:</p>

<pre><code>1
yyy
</code></pre>

<p>Why is read returning 1? This is breaking my script, because I run with <code>set -e</code>.</p>