help-cfengine
[Top][All Lists]
Advanced

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

RE: editfiles and pattern matching


From: Ferguson, Steve
Subject: RE: editfiles and pattern matching
Date: Tue, 15 Jul 2003 10:30:08 -0400

If this is the desired behavior, then at the very least I'd suggest that the
documentation be updated.  Remove references to '^' and '$' as regex
characters if they're implicit in every pattern, and say as much.  Having
them listed implies that the user controls their behavior, which isn't the
case.

Just trying to improve things for anyone who follows down the same road.

Steve

> -----Original Message-----
> From: Chip Seraphine [mailto:chip@trdlnk.com]
> Sent: Tuesday, July 15, 2003 10:14 AM
> To: Ferguson, Steve
> Cc: 'help-cfengine@gnu.org'
> Subject: Re: editfiles and pattern matching
> 
> 
> 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]