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

Re: :s modifier right-hand-side value behaves strangely with a variable



On Sun, Aug 23, 2026 at 1:22 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> You're making an incorrect assumption about evaluation order.

To add a little more color to this:  With HIST_SUBST_PATTERN the
evaluation order changes, "s/b/$rep" does become "s/b/_".  This is
handled at the level of the actual replacements, not at the point
where $str:s/b/$rep is initially parsed.




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