bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: error with ' in command substitution


From: Matthew Woehlke
Subject: Re: error with ' in command substitution
Date: Tue, 30 Oct 2007 15:28:39 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070728 Thunderbird/2.0.0.6 Mnenhy/0.7.5.0

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

[Prev in Thread] Current Thread [Next in Thread]