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

Re: Why a '-quoted string isn't respected by // subst, while \-quoted is?



On Wed, Jan 25, 2023 at 2:00 PM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Ok, I'll take a closer look, however I'm now struggling with similar problem:
>
> QE='0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}'
> print ${QE//'0=${${(M)${0::=${(%):-%x}}:#/*}:-$PWD/$0}'/°match°}
>
> the strings in QE and in …//'…'/… are identical. Why no match?

This looks like a bug in zsh. Here's a simpler test case:

    % x='/'
    % print -r -- ${x/'/'}
    /

I expect the output to be empty but it's in fact "/".

This one also looks wrong:

    % x=\'
    % print -r -- ${x/'/'}

Here the output is empty while I expect a single quote.

Roman.




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