Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: :s modifier right-hand-side value behaves strangely with a variable
- X-seq: zsh-workers 55111
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Jonathan Poelen <jonathan.poelen@xxxxxxxxx>
- Cc: zsh-workers@xxxxxxx
- Subject: Re: :s modifier right-hand-side value behaves strangely with a variable
- Date: Sun, 23 Aug 2026 14:52:37 -0700
- Arc-authentication-results: i=1; mx.google.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UtZQr0abHJV2zWhOwTsslQ6JwV1kfOuItQZLMr9uuws=; fh=lj+Yo+0B75PO9444blLRoPQegX6Sqq+NNuidZoTqPG0=; b=Dfi8ZtlJ0nW/ciKNkKTGS0nqruQjkthhCARzJN21Geh1hWaLpmay/fv/FVwq+1HKhi J0g9aWFzo4/IK4WI0nAnNA+fwhCb7Cx0xSTadRpDkLRSNHMnpRFs4JB6OoYoJJsS2vDr YEBlBr7r0+AiO0AR8va3gBjdGPU6r8JoyiJVQ6Ho84COfWV7FwC9pBrBw7JADumCIFaK aYthOyan1mjMoLe1AdxyBnDaLtnfRKXG1/5Z0W2j/xrjBgZnZ0cVm3CjS6+08P8XxCq6 I7qt9WGf2nb5s7ufjjEtdByeF6PWbjGX7iYc2k5oW+aVk5orWOX001YpMBiGEZs0/LhM oS2Q==; darn=zsh.org
- Arc-seal: i=1; a=rsa-sha256; t=1787521969; cv=none; d=google.com; s=arc-20260327; b=jw55eIVJnumRuBaBTx6dK1wSo47O1fkevXL78JCW1hLvNrwKRzgZfb66SSsr+tpAIs jiYNVXbCulDPRaFhn0rXBaEAX7rStORa0Nuj6iE7BGf56WE2sNqqItKuwYh217z7gvxU SIJKlhb9DVd00uADmO38vfFCDj9WS8zZiG/CRfS/XDnob+O5FoElKTUOjXk2W6RJAPUH Lt261PK5qN225OmJ3AvpeGLbKFzwjZAxW5zVqAbQHh/eRce3QBa5tqFTvHJ4XP0ggUxv 5RLFTZ0hgZC5YXOGxJu0FoPO3jGsAD1lme0vMGkhT6Fv1HJGf8Bh4FU8gSTD0/Lr7s+s aIjg==
- Archived-at: <https://zsh.org/workers/55111>
- In-reply-to: <CAH+w=7YXUCmEftLw8hCKC95xDABu_XsN_tFYuni1wjwGRrsVrg@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAAqh98M5xi5AoK0aFS4gmY6wCCedn=KhLPEGsyRY69YgmgDGww@mail.gmail.com> <CAH+w=7YXUCmEftLw8hCKC95xDABu_XsN_tFYuni1wjwGRrsVrg@mail.gmail.com>
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