Post #1767867
2026-04-26 23:32 UTC
@tux0r
To be fair, there are some minor differences in implementations. Things like
• the x command doing encryption in some versions (has been added-then-removed in some),
• GNU ed no longer allowing the omission of trailing slashes in s commands like s/regex
• GNU ed offering y to yank lines and x to put lines
• GNU ed provides # for script comments, but that's rejected in the other versions I have available
If you stick to POSIX, the only odd-one-out is the s/regex which GNU breaks (according to POSIX, "If the closing delimiter of an RE or of a replacement string (for example, '/' ) in a g, G, s, v, or V command would be the last character before a , that delimiter can be omitted" [emphasis mine])
@aartaka
edit: markdown ate less-than-sign
Replies (2)
-
@tux0r@layer8.space 2026-04-26 23:35
@ed1conf @aartaka See, sam(1) is an easier target, with one implementation. ;-) ed is easy until it isn’t. And I *did* stumble upon the closing delimiters more than once.
-
@aartaka@merveilles.town 2026-04-26 23:37
@ed1conf @tux0r the closing delimiter thing is not POSIX, but it enables newline insertion in g et al., and also works on OpenBSD ed and slewsys ed (didn’t test on Mac.) So I’m ready to live with this consensus “standard.”