[TUHS] Posix ed weirdness

Cameron Míċeál Tyre via TUHS tuhs at tuhs.org
Wed Dec 17 01:26:54 AEST 2025


Hi Doug,

Thank you. I use ed all the time, on every machine/device I have, but I did not know it was possible to join more than two lines at a time and I never thought of trying.

I guess the syntax would have been simpler if only two could be joined at one time, something like 2j to join line 2 and line 3. The very fact that the syntax to join line 2 and line 3 would be
2,3j
cries out, "I can join more than two lines!", but I just never figured it out.

Now I know!

Best regards,

Cameron





-------- Original Message --------
On Monday, 12/15/25 at 21:56 Douglas McIlroy via TUHS <tuhs at tuhs.org> wrote, in part:

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.


More information about the TUHS mailing list