,n and ,ln are also becoming favorite #ed commands.
Of course, also w !less --wordwrap -N 😅
@rl_dane @ed1conf @mwl
I love his style of writing as well!
Where there's a lineage or evolution, I really like to start as close to the origin as possible (or at least read about it). It gives context for what's come after and I find gives me a better intuition for things.
I'm looking forward to any future posts as you're using ed(1) and it's descendents :)
,n and ,ln are also becoming favorite #ed commands.
Of course, also w !less --wordwrap -N 😅
I came across a problem in #ed where I couldn't change a url, because it was full of slashes, which made the substitution command fail. I popped into vi to make that change, but then thought about how I might do it in ed in the future.
What I realized is that I could split the lines where the URL stops and ends, replace the line that had just the URL itself (pasting in the new URL without having to backslash-escape the slashes), and then re-join the lines.
Of course, NOW I just realized I could've done s,([^)]*),(new_url), instead, but whatevs, lol
rld@Intrepid:~$ ed
a
Here is some text
I need to change [this link](https://example.com/some/stuff/here), ok?
some more text
.
,n
1 Here is some text
2 I need to change [this link](https://example.com/some/stuff/here), ok?
3 some more text
2s/(/(\
/
,n
1 Here is some text
2 I need to change [this link](
3 https://example.com/some/stuff/here), ok?
4 some more text
3s/)/\
)/
,n
1 Here is some text
2 I need to change [this link](
3 https://example.com/some/stuff/here
4 ), ok?
5 some more text
2a
https://archive.org/details/plan9designintro/mode/2up
.
,n
1 Here is some text
2 I need to change [this link](
3 https://archive.org/details/plan9designintro/mode/2up
4 https://example.com/some/stuff/here
5 ), ok?
6 some more text
4d
,n
1 Here is some text
2 I need to change [this link](
3 https://archive.org/details/plan9designintro/mode/2up
4 ), ok?
5 some more text
2,4j
,n
1 Here is some text
2 I need to change [this link](https://archive.org/details/plan9designintro/mode/2up), ok?
3 some more text
#ed wizards...
How do you "pipe the contents of this line to command foo and replace the line with the result of that command?"
(On BSD ed, not GNU ed)
Thanks! :D