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

Re: Bug in Functions/Misc/regexp-replace



On Thu, Apr 29, 2021 at 11:51 PM Stephane Chazelas
<stephane@xxxxxxxxxxxx> wrote:
>
> One might argue there's a problem with the (q) parameter
> expansion flag, it escapes leading =s but not the =s that follow
> : even though they're special there in assignments.

Arguably (q) should either quote all =s or none of them.  It has no
idea what appears outside the parameter reference, that is, there's no
reason for it to treat a leading = as being the start of a word in the
surrounding context (or to believe the context is assignment).  I
can't think of any situation where I've depended upon the
quotes-leading-equal behavior.

On the other hand the check for a leading equal means that (q-) would
work here (and is frequently better than just (q) for other reasons).




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