Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15572

Re: Incomplete command substitution in here-document not regarded as an error

Path csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail
From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: Incomplete command substitution in here-document not regarded as an error
Date Thu, 7 Nov 2019 15:06:37 -0500
Lines 22
Approved bug-bash@gnu.org
Message-ID <mailman.846.1573157206.13325.bug-bash@gnu.org> (permalink)
References <CAH7i3Lp7ZQZj2FmXBa8fG8oY01GMbNKy916i1jcUt0eq57x8Tg@mail.gmail.com> <80152716-0776-f052-cfd3-7159fcfbe6b0@case.edu>
Reply-To chet.ramey@case.edu
NNTP-Posting-Host lists.gnu.org
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 8bit
X-Trace usenet.stanford.edu 1573157207 9444 209.51.188.17 (7 Nov 2019 20:06:47 GMT)
X-Complaints-To action@cs.stanford.edu
Cc chet.ramey@case.edu
To Oğuz <oguzismailuysal@gmail.com>, bug-bash@gnu.org
Envelope-to bug-bash@gnu.org
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1573157199; bh=JzQS3dFbdVQLfKD+mQotJSiHM6tnDapVokuDUYm0jbY=; h=Reply-To:Cc:Subject:To:References:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=QFXGcReAS3kMs7tLDXRftp95aJny81Bjcywa52SP8vxpE5JxkB6dNo4NIts98MmmI3 JwLiSyehePwJNTWfTzGjgtwhzuLGXBdnv2HvsquLAxFwNHnHxslO4ggSunEH32pkyYP yEfweNWsop1XR/NFK55J8Omtn2Lvlaix+c/4K8X8IB+bE6L9zobdTn7N32MfsK7F9SY Y6IWYfYEL+aP2E33VXRs6+cmvpabsoDaTBmWezVfF5NRCmVaAaMkOe2C/ni1+A04KXs V7raY0BHg5FRdI/8uhEt7ZcfcXv1cVe2+4XT4WSmxgMqU8A7bMnD8S75e4Pg4Bdmu0s 4/HetgYw==
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=case.edu; s=smtp-primary; t=1573157198; bh=Qth0FBsPrdC78PLoaw6vKQ47gy3uj0TPrQQG7s3sJNA=; h=Reply-To:Cc:Subject:To:References:From:Message-ID:Date: MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=UFKwGZO0OfmaGW4yl5zMZDmHBYAGkAocsad3koQyltqkk4v0MH/ofOY44IVbAcmL7I ZqDBcvqNZ9awyNqCWSYucv2aD4SmTUD0tpRJ9nqdV5otMpOMqUr2IDiCK4oEjcmRuGP 3ONC9pUnssDoGrfD6aJzy5kmqxZ/mPRHptfDDu8HnCvlNPjEG1vwPsWbuWxWZ3e6p5f 8DJ5gHNTarcdiKiq6p44/4F+AEsicjvTxE//IGt8b+euOOiTnDU7+I9OjRWyehEcDXR OflE/FSdWJA1G9a1W3JHWdQpERkS5/REpkqcF+4QP4Y+kmlI7fIHitjrASZmHwD2J6l +4fPQbtw==
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.2.1
In-Reply-To <CAH7i3Lp7ZQZj2FmXBa8fG8oY01GMbNKy916i1jcUt0eq57x8Tg@mail.gmail.com>
Content-Language en-US
X-Junkmail-Status score=7/90, host=mpv1-2015.case.edu
X-Junkmail-PrAS-Raw score=7/90, refid=2.7.2:2019.11.7.193017:17:7.944, ip=, rules=DKIM_SIGNATURE, __HAS_REPLYTO, __HAS_CC_HDR, __SUBJ_REPLY, __PHISH_SPEAR_SUBJ_ALERT, __BOUNCE_CHALLENGE_SUBJ, __BOUNCE_NDR_SUBJ_EXEMPT, __SUBJ_ALPHA_END, __TO_MALFORMED_2, __TO_NAME, __TO_NAME_DIFF_FROM_ACC, __HAS_REFERENCES, __REFERENCES, __HAS_FROM, FROM_EDU_TLD, __HAS_MSGID, __SANE_MSGID, DATE_TZ_NA, __USER_AGENT, __MOZILLA_USER_AGENT, __MIME_VERSION, __IN_REP_TO, __CT, __CT_TEXT_PLAIN, __CTE, __REPLYTO_SAMEAS_FROM_ADDY, __REPLYTO_SAMEAS_FROM_ACC, __FROM_DOMAIN_IN_ANY_CC1, __FROM_DOMAIN_IN_ANY_CC2, __REPLYTO_SAMEAS_FROM_DOMAIN, __DKIM_ALIGNS_1, __DKIM_ALIGNS_2, __ANY_URI, __URI_WITH_PATH, __URI_NO_WWW, __CP_URI_IN_BODY, __FRAUD_MONEY_CURRENCY_DOLLAR, __SUBJ_ALPHA_NEGATE, __URI_IN_BODY, __URI_NOT_IMG, __FORWARDED_MSG, __BODY_NO_MAILTO, __NO_HTML_TAG_RAW, BODY_SIZE_700_799, BODYTEXTP_SIZE_3000_LESS, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, [TRUNCATED], so=2010-03-03 19:42:08, dmn=2016-08-03-0138
X-detected-operating-system by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] [fuzzy]
X-Received-From 129.22.103.226
X-BeenThere bug-bash@gnu.org
X-Mailman-Version 2.1.23
Precedence list
List-Id Bug reports for the GNU Bourne Again SHell <bug-bash.gnu.org>
List-Unsubscribe <https://lists.gnu.org/mailman/options/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=unsubscribe>
List-Archive <https://lists.gnu.org/archive/html/bug-bash>
List-Post <mailto:bug-bash@gnu.org>
List-Help <mailto:bug-bash-request@gnu.org?subject=help>
List-Subscribe <https://lists.gnu.org/mailman/listinfo/bug-bash>, <mailto:bug-bash-request@gnu.org?subject=subscribe>
X-Mailman-Original-Message-ID <80152716-0776-f052-cfd3-7159fcfbe6b0@case.edu>
X-Mailman-Original-References <CAH7i3Lp7ZQZj2FmXBa8fG8oY01GMbNKy916i1jcUt0eq57x8Tg@mail.gmail.com>
Xref csiph.com gnu.bash.bug:15572

Show key headers only | View raw


On 11/6/19 4:37 PM, Oğuz wrote:
> cat <<EOF
> $(seq 10
> EOF
> 
> prints 1, while it should report a syntax error.

Thanks for the report. Bash has, for some years, allowed EOF/EOS to 
terminate a command substitution in certain circumstances, but this really
only shows up when you're expanding it inside a here-document. There is a
(relatively cryptic) warning message, but that only shows up in development
builds. It seems reasonable to make the behavior when expanding here-
documents match the behavior outside them.

Chet


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
		 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: Incomplete command substitution in here-document not regarded as an error Chet Ramey <chet.ramey@case.edu> - 2019-11-07 15:06 -0500

csiph-web