On 03/21/2012 04:15 PM, no-re...@cfengine.com wrote: > Forum: CFEngine Help > Subject: Performing a simple edit with replace_patterns > Author: daveseff > Link to topic: https://cfengine.com/forum/read.php?3,25344,25344#msg-25344 > > Hi, > > I have a text file with some content and parameters. One parameter is > > > default=0 > > > > My edit_line is > > > bundle edit_line myedit_inform_grub { > replace_patterns: > "default=0" replace_with => value("default=1"); > > }
It worked fine for me, running 3.2.1 Here are the files I used to test. -- Nick Anderson <n...@cmdln.org>
body common control { bundlesequence => { "main", }; inputs => { "cfengine_stdlib.cf", }; } bundle agent main { files: "/tmp/grub.conf" edit_line => myedit_inform_grub; } bundle edit_line myedit_inform_grub { replace_patterns: "default=0" replace_with => value("default=1"); }
default=0
default=1
_______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine