Forum: Cfengine Help Subject: Insert line when regexp does not match Author: Lars.O Link to topic: https://cfengine.com/forum/read.php?3,18868,18868#msg-18868
I started with version 3 last week. I've not yet grown accustomed to the new semantics. But I've managed to get some things running. I've read the tutorial, and I've tried to RTFM ;-), I've looked at Cfengine solutions, Community open promise body library, and cfengine_stdlib.cf, but I don't find the answer to this in there: I want to edit a file and 'if no line matches/contains "regexp or string" then insert "new line"'. And if a new line is inserted, then I want to set a class. In version 2 this would be something like editfiles: { file BeginGroupIfNoLineMatching "x*yz" AppendIfNoSuchLine "new line" EndGroup DefineClasses "action" } How is this done in version 3? And where in the documentation is it explained? _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine