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

Re: Is outer quoting not needed (docs say "redundant")?



On 13 Jan 2018 at 18:36:39, Bart Schaefer (schaefer@xxxxxxxxxxxxxxxx) wrote:
> These are not the same. Because of the way backslashes behave when
> they follow the :- operator plus the effect of the (z) flag, the
> latter is actually the same as
>  
> arr=( "${(@Q)${(z@):-"a\ b" c}}" )
>  
> You can see this if you examine the inner expansion in isolation:
>  
> % print -rl ${(z@):-"a b" c}
> a
> b
> c
> % print -rl ${(z@):-a\\ b c}
> a\ b
> c
>  

Thanks. The point about "a\ b" shows that quotes are indeed active. However for final output, it's like " is being merged into quasi-quotes that are between :- and }.

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org



Messages sorted by: Reverse Date, Date, Thread, Author