Forum: Cfengine Help
Subject: Re: Cfengine Help: Re: edit_line / syntax help
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,20761,20763#msg-20763

You may either do

(1) editing the file 4 times or


"/tmp/testfile"
edit_line => test_edit("string1","string1Edit");

"/tmp/testfile"
edit_line => test_edit("string2","string2Edit");

"/tmp/testfile"
edit_line => test_edit("string3","string3Edit");

"/tmp/testfile"
edit_line => test_edit("string4","string4Edit");



(2) creating your own special edit_line body to edit all of them at once.


"/tmp/testfile"
edit_line => my_own_edit;

bundle edit_line my_own_edit
{
 replace_patterns:
    "string1" replace_with => value("string1Edit)");
    "string2" replace_with => value("string2Edit)");
    "string3" replace_with => value("string3Edit)");
    "string4" replace_with => value("string4Edit)");
}


Cheers,
--Nakarin

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to