NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/59803: sed(1) conditional branch command confuses subsequent line addressing
The following reply was made to PR bin/59803; it has been noted by GNATS.
From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: bin/59803: sed(1) conditional branch command confuses subsequent
line addressing
Date: Sun, 30 Nov 2025 12:42:52 +0300
On Sun, Nov 30, 2025 at 06:45:02 +0000, elo%sdf.org@localhost via gnats wrote:
> of those scenarios is it yet clear to me in the abstract why or how
> the address range should be rendered ineffectual when the text in the
> pattern space in a given cycle has not been substituted, and the 't'
> command consequently has not altered the program flow.
A bit further down in the man page:
A command line with two addresses selects an inclusive range. This
range starts with the first pattern space that matches the first
address. [...]
The pattern space with the third line in it never matched the first
address of 3,$ range b/c "t" command caused that bit of the sed script
to be skipped over. That seems like a pretty straightforward
procedural semantic.
The interpretation you seem to expect (declarative in spirit, not
procedural) makes address ranges (two addresses) behave radically
different from single address, if I understand correctly. AFAICT you
expect all range toggles to always get checked regardless of the
program flow, but the action part to only get executed according to
the program flow. Just thinking about that makes my head hurt :)
-uwe
Home |
Main Index |
Thread Index |
Old Index