read -r -d '' TMP <<<'hello'
successfully writes "hello" to $TMP, yet the exit status is 1.
Is this expected/intended? Should I just put ! at the start of that line to invert the exit code if I want to to succeed when it succeeds?
N.B. the above example is simplified. Here's the full thing:
IFS='' read -r -d '' SLACK_PAYLOAD <<'JSON'
{
"channel": $channel,
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": $message
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": $changelog
}
}
]
}
JSON
I'm mostly using read because I want multiple lines.
To be even more clear, my script is using
#!/usr/bin/env -S bash -eio pipefail
It appears there are some subtle differences with zsh which I'm not really opposed to (I use it as my shell but not for scripts), but my script is already written for bash.