help-cfengine
[Top][All Lists]
Advanced

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

Re: Bug in LocateLineMatching?


From: Alexander Mattausch
Subject: Re: Bug in LocateLineMatching?
Date: Tue, 04 Feb 2003 11:16:12 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.2.1) Gecko/20021130

Harald Hannelius schrieb:

Alexander,

thanks for the tip but I figured that out already. The point wasn't on how
to accomplish this but rather the difference between what the docs say and
the progs do. If the doc say beginning of the line and the software adds
to the end of the line either the docs or the software is wrong, right?

Since there are many existing and working scripts out there I would say it's the docs ;-)

It's true, the documentation is a little bit unclear on this point. LocateLineMatching sets the line pointer to the line matching the RegEx, while InsertLine inserts _after_ that position.

I've created a patch for the documentation, perhaps it is a little bit clearer this way.

Regards,
Alex

--- cfengine-Reference.texinfo.orig     Tue Feb  4 11:10:52 2003
+++ cfengine-Reference.texinfo  Tue Feb  4 11:09:43 2003
@@ -4809,8 +4809,8 @@
 of the file.
 
 @item InsertLine @var{quoted-string}
-Inserts the quoted string as a line at the current
-position in the file. After the insert, the file
+Inserts the quoted string as a line after the current
+line pointer in the file. After the insert, the line
 pointer is incremented by one so that subsequent
 inserted lines are placed after the first.
 This should probably be used in conjunction with the
@@ -4819,13 +4819,12 @@
 
 
 @item LocateLineMatching @var{quoted-regex}
-Moves the current-position pointer to the start
-of the line matching the quoted regular expression.
-If there is no match, a warning is only issued in
-verbose mode, but all editing is immediately
-aborted. See also @code{WarnIfNoLineMatching}
-so that you can get an explicit warning, even
-out of verbose mode.
+Moves the current line pointer to the line matching the
+quoted regular expression. If there is no match, a
+warning is only issued in verbose mode, but all 
+editing is immediately aborted. See also
+@code{WarnIfNoLineMatching} so that you can get an 
+explicit warning, even out of verbose mode.
 
 @item   PercentCommentLinesContaining @var{quoted-string}
 Add a @samp{%} to the start of any line containing the quoted string.

reply via email to

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