Zsh Mailing List Archive
Messages sorted by:
Re: syntactic question
- X-seq: zsh-users 19416
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: syntactic question
- Date: Fri, 21 Nov 2014 15:46:20 -0800
- Cc: Zsh Users <zsh-users@xxxxxxx>
- In-reply-to: <CAH+w=7ay7Mr8vdUtTZqo1voRg5vpMaGXEt8207h8cpErMqByKw@mail.gmail.com>
- List-help: <mailto:firstname.lastname@example.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:email@example.com>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <546F9F41.firstname.lastname@example.org> <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@xxxxxxxxxxx
> 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
It's one of those things that's hard to get into one's DNA.
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.
> 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.
Messages sorted by: