Dan Track wrote:
... I want to add a few lines after matching a couple of lines in a
file using sed, ...

sed can be awkward when working with more than one line at a time.

Can you use perl?

$ perl -pe 'BEGIN{undef $/};s/server 10.33.45.3\nserver ldap.example.com\nserver orion/# server 10.33.45.3\n# server ldap.example.com\n# server orion\n\nserver fire.example.com\nserver earth.example.com\nserver space.example.com\n/s' <test.conf

(That's meant to be all on one line.)

<Joe

--
fedora-list mailing list
[email protected]
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Reply via email to