[TUHS] Posix ed weirdness
Clem Cole via TUHS
tuhs at tuhs.org
Tue Dec 16 08:19:26 AEST 2025
Doug,
Do you know what later AT&T Summit versions did? And/or SVID
Clem
On Mon, Dec 15, 2025 at 4:56 PM Douglas McIlroy via TUHS <tuhs at tuhs.org>
wrote:
> The ed j command joins a sequence of lines into one line and sets dot
> to the result. Thus
> 2,4j
> combines three lines and sets dot to 2. Naturally one expects
> 2,2j
> to make no visible change to the file, but to set dot to 2.
>
> Indeed, that's what v7 did. But Posix decrees that j "does nothing" in
> this case and leaves dot at the value it had before the command.
>
> Does anyone know why the Posix committee chose to break both the
> original behavior and Kernighan's law: " 'Do nothing' gracefully"?
>
> Doug
>
More information about the TUHS
mailing list