From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17918 invoked by alias); 21 Nov 2014 23:46:27 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19416 Received: (qmail 1911 invoked from network); 21 Nov 2014 23:46:24 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-Authority-Analysis: v=2.1 cv=HYUtEE08 c=1 sm=1 tr=0 a=SBdK3agBVlyT/P6vVha89Q==:117 a=SBdK3agBVlyT/P6vVha89Q==:17 a=G8GL833Es-AA:10 a=IkcTkHD0fZMA:10 a=UkNTdlc1t1YZtMPhDNIA:9 a=QEXdDO2ut3YA:10 Message-id: <546FCECC.70602@eastlink.ca> Date: Fri, 21 Nov 2014 15:46:20 -0800 From: Ray Andrews User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-version: 1.0 To: Bart Schaefer Cc: Zsh Users Subject: Re: syntactic question References: <546F9F41.8040608@eastlink.ca> In-reply-to: Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: 7bit On 11/21/2014 01:29 PM, Bart Schaefer wrote: > > > On Nov 21, 2014 12:25 PM, "Ray Andrews" > wrote: > > > > I've always thought that all parsing systems work from the 'inside out' > > which is to say that (as with math) you 'do' the deepest parenthesis > > first, and then work outward. > > Quotes aren't parens, there is no left and right so you can't nest > them the way you are thinking of. With only a small number of > exceptions, quoting in shells works left to right - once a quote is > open, you obey only the rules of that type of quote until it closes > again. Backslashes happen to have special meaning both inside and > outside of quotes, but the details depend on which type of quote is > active. > It's one of those things that's hard to get into one's DNA. > > > In the same spirit, I'm expecting > > the substitution to do what it does following it's own rules and > > nevermind any quotations or anything else 'further out'. > > Substitution occurs if there are no quotes or inside double quotes, > but not inside single quotes. The rules are different when in double > quotes, and documented. > Well, as long as the system works, and is understandable. I think my intuitions are forgivable, even if not correct. Bart, is there some readable doc that wraps it all up? In practice I get most all my problems solved now, but I despair of really understanding it, I tend to use trial and error.