help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: take action if line exists


From: Mark Burgess
Subject: Re: take action if line exists
Date: Fri, 04 Nov 2005 10:58:54 +0100

This is easily added. You can get a patched version at the svn
repsository or latest snapshot. Be careful with this however.
You could make non-convergent edits like this.
M

On Thu, 2005-11-03 at 10:11 -0600, Mark McCullough wrote:
> I've been finding myself more and more wanting to take an editfile
> action if and only if a line exists in a file.  I know, I could
> hypothetically use LocateLineMatching, but I have lots of edits that
> need to be done to the file if and only if a certain line exists.
> 
> What I seem to be wanting is something along the lines of:
> 
> BeginGroupIfLineMatching
> ...
> EndGroup
> 
> In other words, a complement to the old standby of
> BeginGroupIfNoLineMatching
> 
> I haven't figured out a reasonable method shy of using a class defined
> by a grep output to trigger this, and that becomes problematic for me
> when I go multi-platform.  (Solaris requires /usr/xpg4/grep for grep -q,
> Linux has it internal, ...)
> 
> Or is there some easy way I'm overlooking to do this?
> 
> _______________________________________________
> Help-cfengine mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-cfengine





reply via email to

[Prev in Thread] Current Thread [Next in Thread]