From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11828 invoked from network); 1 Jun 1999 12:54:08 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Jun 1999 12:54:08 -0000 Received: (qmail 28568 invoked by alias); 1 Jun 1999 12:53:41 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 6423 Received: (qmail 28560 invoked from network); 1 Jun 1999 12:53:39 -0000 From: "Andrej Borsenkow" To: "Peter Stephenson" , "Zsh hackers list" Subject: RE: PATCH: pws-19: minor syntactic innovation Date: Tue, 1 Jun 1999 16:52:30 +0400 Message-ID: <001a01beac2d$9c1ec2c0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 In-Reply-To: <9906010821.AA38598@ibmth.df.unipi.it> Importance: Normal > > This isn't due to the change I made, it simply showed up because of that. > The cause is dquote_parse(), which is doing brace-counting; in > other words, > it rejects the second `"' as the end of the quoted string because it > detected the ${. So this behaviour seems to be entirely deliberate. > I beg your pardon, I was just too eager. Looking more closely in Single Unix reveals: The dollar-sign retains its special meaning introducing parameter expansion (see Parameter Expansion ), a form of command substitution (see Command Substitution ), and arithmetic expansion (see Arithmetic Expansion ). The input characters within the quoted string that are also enclosed between "$(" and the matching "(" will not be affected by the double-quotes, but rather define that command whose output replaces the $(...) when the word is expanded. The tokenising rules in Token Recognition are applied recursively to find the matching ")". Within the string of characters from an enclosed ${ to the matching "}", an even number of unescaped double-quotes or single-quotes, if any, must occur. A preceding backslash character must be used to escape a literal "{" or "}". The rule in Parameter Expansion will be used to determine the matching "}". In other words, Zsh (and bash) both behave "POSIXLY-correct" at least in the respect to correct expressions. /andrej