News for hackers. Stuff that matters.
Re:S/Sed/Ed by McUsr on Friday November 15, 2024 @08:25AM (#42146711)
Using ed interactively, so you can work out some complex operation step by step, is a valid point for using ed instead of sed. Sometimes however, awk is the correct solution. (Why sit and mess with it, if awk provides a straight forward solution.)
Re:S/Sed/Ed by sgarland on Friday November 15, 2024 @11:57AM (#42148648)
Agreed, though you have to be careful not to rely on gawk (or mawk, etc.) specific features. To be fair, the exact same problem exists between sed and gsed.

I always install gnu-utils on Macs because I find them to be easier, but if I need to share with coworkers, I have to go back and ensure they’re portable.

Re:S/Sed/Ed by riedel on Friday November 15, 2024 @06:46PM (#42152647)
Actually interactive editing with ed saved my ass once on my FreeBSD server once. Somehow, my terminal driver (actually I actually used my vt520 even for emails at the time) was totally broken so I only had a single line. I actually managed to edit the settings file with ed to get things straight and do a reboot. However, if you know sed you should be able to handle. However, this was 2001 or so and I somehow doubt that I it will happen again ...