help-cfengine
[Top][All Lists]
Advanced

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

Re: editfiles and pattern matching


From: Chip Seraphine
Subject: Re: editfiles and pattern matching
Date: Tue, 15 Jul 2003 09:14:19 -0500
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:1.2.1) Gecko/20030121

The only thing wierd about it is an implicit '^' at the start and '$' at the end. If you want to override that, toss a '.*' before or after your pattern. Not sure why Mark chose this approach, but I would assume the engine doesn't like multiline matches and the implied boundaries discourage people from trying it.

That being said, it really isn't wacky enough to get a grass-roots movement started over it :-) I think most of us are sufficiently used to it that it falls under 'desired behavior', even if it surprised us the first time around...

Ferguson, Steve wrote:
Thanks! This seems to do what I want.

The larger question: Is there any reason a pattern match must apply to the
entire line?  Is there any plan to make this work like most other regex
engines or is this the desired behavior?

Steve


-----Original Message-----
From: skaar [mailto:skaar@aol.net]
Sent: Monday, July 14, 2003 2:46 PM
To: Ferguson, Steve
Cc: 'help-cfengine@gnu.org'
Subject: Re: editfiles and pattern matching



   # Ensure cfengine port is declared in /etc/services
   { /etc/services
SetLine "cfengine 5308/tcp #

cfengine port"

     AppendIfNoLineMatching "^cfengine"
   }

try to match the entire line "^cfengine.*"




_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://mail.gnu.org/mailman/listinfo/help-cfengine






reply via email to

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