bug-ed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [feature] Add edscript as a shortcut for running ed with script


From: Andrew L. Moore
Subject: Re: [feature] Add edscript as a shortcut for running ed with script
Date: Mon, 16 Dec 2024 10:01:03 -0500
User-agent: Mozilla Thunderbird Beta

On 12/16/24 02:05, Artyom Bologov wrote:
Hi Andrew,

For anyone interested in scripting with ed, please consider:
<https://github.com/slewsys/ed>.
Indeed, a fork is one of the options. But I'm more interested in getting
features into "mainstream" ed implementation, because that'll be most
beneficial for everyone everywhere.

As the author of both GNU ed and the "fork", I agree. Fortunately, there is not a single choice. When writing portable code, the least common denominator makes sense, which generally means POSIX. But we all enjoy and leverage GNU extensions when opportunity permits. Unfortunately, and for no rational reason, GNU ed never evolved beyond POSIX, as did the rest of the GNU ecosystem. Fortunately, the "fork" exists. It is what GNU ed should be.

Antonio has hinted that he intends to adopt some of its capabilities,
which include the options -f and -e, external filters, the ability to
edit the output of named pipes, multiple-file support, registers, etc.
-f and -e would indeed be perfect and much more preferable than my
  initial "edscript" suggestion!

These are not difficult to implement, and as I've told Antonio repeatedly, he is free to use my code. So hopefully we can all look forward to adoption of these improvements soon.

An extension inspired by `ex'
At this point, I'm not sure I want to venture into ex territory. ex is
ex, ed is ed, and conflating the two is confusing. -f is fineā€”it's
(supposedly) a simple and compatible change.

And the list goes on. What this implementation of ed does not adopt is
the branching constructs of sed `b', `t' and `T' since ed has enough
strengths without,
Fair!

and higher-level scripting languages like `awk' are
easier to work with.
I'm an ed fundamentalist using ed for everything, so I don't necessarily
agree, but I see what you mean here and acknowledge the soundness of the
point.

Best of luck,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]