zsh-users
 help / color / mirror / code / Atom feed
From: Ray Andrews <rayandrews@eastlink.ca>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh Users <zsh-users@zsh.org>
Subject: Re: syntactic question
Date: Fri, 21 Nov 2014 15:46:20 -0800	[thread overview]
Message-ID: <546FCECC.70602@eastlink.ca> (raw)
In-Reply-To: <CAH+w=7ay7Mr8vdUtTZqo1voRg5vpMaGXEt8207h8cpErMqByKw@mail.gmail.com>

On 11/21/2014 01:29 PM, Bart Schaefer wrote:
>
>
> On Nov 21, 2014 12:25 PM, "Ray Andrews" <rayandrews@eastlink.ca 
> <mailto:rayandrews@eastlink.ca>> 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.


  reply	other threads:[~2014-11-21 23:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 20:23 Ray Andrews
2014-11-21 21:29 ` Bart Schaefer
2014-11-21 23:46   ` Ray Andrews [this message]
2014-11-22  0:00     ` Bart Schaefer
2014-11-22  1:40       ` Ray Andrews
2014-11-21 21:42 ` Kurtis Rader
2014-11-21 23:45   ` Bart Schaefer
2014-11-22  4:39     ` Ray Andrews

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=546FCECC.70602@eastlink.ca \
    --to=rayandrews@eastlink.ca \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).