help-cfengine
[Top][All Lists]
Advanced

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

Re: editfiles missing the profound function?


From: Brendan Strejcek
Subject: Re: editfiles missing the profound function?
Date: Wed, 23 Feb 2005 10:42:24 -0600
User-agent: Mutt/1.5.6+20040907i

Yaroslav Halchenko wrote:

Mark Burgess wrote:

> The reason is that "assign value" assumes a particular format of the
> file you are editing. It is not general enough to warrant its own
> function. Perhaps we can think of something else.

There are plenty of current editfiles functions that assume a particular
format of the edited file. For example, all the HashCommentLines.*
functions. This has come up many times before. I think we just have to
accept the fact that Mark does not like it. :-)

In any case, this has been what I have been doing to solve this problem
recently. It's still two lines, but I think it is more readable than
anything else I have seen.

    DeleteLinesMatching "^somevar = .*$"
    AppendIfNoSuchLine "somevar = somevalue"

You have to have some knowledge of the contents of the file you are
editing, but in practice this is not really a problem.




reply via email to

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