Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is outer quoting not needed (docs say "redundant")?
On 12 Dec 2017 at 16:00:24, Peter Stephenson (p.stephenson@xxxxxxxxxxx) wrote:
> the substitution. So if necessary they will flag up the fact that the
> internal expression is double quoted. But because the parameter
> substitution in this case is already double quoted, they have no
> additional effect.
>
> There may be a better example to use in the manual: the example here
> uses the "@" flag for splitting, which is only meaningful if the outer
> quotes are present. But it does have the use of pointing out that
> the double quotes are nested --- which might not be obvious, you
> might naively think the "${" and "}" were in two different
> double-quoted expressions.
Yes the example shows this and that's why I'd keep it. Going further, I once had serious doubts about such quotings overlapping. Digged out a code:
gitout=( "${(@f)"$( "${gitcmd[@]}" )"}" )
Is it the same? Top-level quotes mark ${gitcmd[@]} as quoted, so splitting, etc. is done regardless of bottom quoting, but each quoting is kept separate and they don't interact when they are parsed?
--
Sebastian Gniazdowski
psprint /at/ zdharma.org
Messages sorted by:
Reverse Date,
Date,
Thread,
Author