Scott Moser wrote:
Description:
#===== test.sh =====
x=$(cat <<"EOF"
bad' syntax
EOF
)
#=== end test.sh ===
[snip]

So, I'm not 100% certain what the "correct" behavior is, but it
certainly seems like this should work.

Given that:

cat << EOF
bad' syntax
EOF

...is correct syntax, IMO the same in command substitution should also be legal. In fact, this strikes me as a definite bug, because there does not seem to be a way to produce an unmatched single quote in a heredoc inside $() command substitution (nor using `` depending on your bash version, I guess).

FWIW, kate recognizes this as legitimate syntax (i.e. correctly "sees" the heredoc inside the substitution).

--
Matthew
<punchline removed due to distasteful content>



Reply via email to