Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!usenet.stanford.edu!not-for-mail From: Chet Ramey Newsgroups: gnu.bash.bug Subject: Re: Multi-line bash strings that end in ! improperly treated as event designator Date: Mon, 24 Aug 2015 10:53:06 -0400 Lines: 31 Approved: bug-bash@gnu.org Message-ID: References: <55DB19F9.6040309@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 Content-Transfer-Encoding: 7bit X-Trace: usenet.stanford.edu 1440428002 17502 208.118.235.17 (24 Aug 2015 14:53:22 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org, chet.ramey@case.edu To: Lane Schwartz Envelope-to: bug-bash@gnu.org X-Enigmail-Draft-Status: N1110 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 In-Reply-To: X-Junkmail-Status: score=10/50, host=mpv5.cwru.edu X-Junkmail-Whitelist: YES (by domain whitelist at mpv2.tis.cwru.edu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 129.22.105.37 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com gnu.bash.bug:11433 On 8/24/15 10:16 AM, Lane Schwartz wrote: > In light of your comments, might I suggest two additions to the manual? > > * History expansion takes place before quote removal. (This could be added > to the bullet list in Section 3.5) I would think that the following sentence from the HISTORY EXPANSION section of the man page would be more relevant: History expansion is performed immediately after a complete line is read, before the shell breaks it into words. I will see whether that sentence needs to be added to the history texinfo manual. > * Beginning with Bash version X.Y.Z, history expansion is suppressed within > double-quoted strings, but only when the opening and closing quotes are on > the same line. (This could be added to Section 3.1.2.3 and/or Section 9.3) In bash-4.3, this is restricted to the case where the exclamation point immediately precedes the closing double quote. In effect, an open double quote temporarily adds double quote to the set of characters that inhibit history expansion when found immediately after the history expansion character. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/