Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: syntactic question



On Nov 21, 2014 12:25 PM, "Ray Andrews" <rayandrews@xxxxxxxxxxx> 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.

> 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: Reverse Date, Date, Thread, Author