reinplace first occurrence

db iamsudo at gmail.com
Thu Aug 3 20:19:54 UTC 2017


On 3 Aug 2017, at 18:46, Ryan Schmidt <ryandesign at macports.org> wrote:
> You could run a two-command sed manually (with system, not reinplace). Or maybe you can use awk, or an ed script.

This works. Caveat emptor: || (empy RE) doesn't work and range seems to start on first line, not on its subsequent.

reinplace -E 1,/foo/s|foo|foo\\\n\\\tbar| file

> I can't remember anybody asking for this functionality (replace first occurrence) before, so that's why there isn't an easy way to do it.

I needed to add disabled/true to a startup item provided by a port's source.


More information about the macports-dev mailing list