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: Mon, 1 Dec 2025 04:12:37 +0300
On Mon, Dec 01, 2025 at 00:15:01 +0000, RVP via gnats wrote:
> but, there's a major difference between these two: even in a
> stream, sed can _always_ retrieve the current line number (even
> with `sed -i '' file.txt'). Whereas of course, when the pattern is
> gone, it's gone and you can't determine the applicable range. So,
> with line numbers, you can act on the rest of the range.
But why would you want to make them behave differently?! It goes _so_
against the POLA... Also see the awk example. In awk the two tests
in the toggle pattern are just expressions, line numbers are not
special in any way (they are just tests on NR). Breaking the sed/awk
symmetry seems like a bad idea.
-uwe
Home |
Main Index |
Thread Index |
Old Index