cfengine-like file editing module?

Daniel Pittman daniel at rimspace.net
Wed Feb 11 06:33:25 CST 2004


On Wed, 11 Feb 2004, Timothy S. Nelson wrote:
> Hi all. I've been playing with a new sysadmins tool called cfengine
> recently (and any admins on this list should have a look at it).

It's an old favorite of mine.  It has plenty of weak spots, IMO, and
the file editing is one of them.  Perl would actually make it much
nicer.

> Anyway, it has an editfiles section which does some cool file editing
> stuff, although even the creator agrees the syntax is bad. Anyway, I
> was wondering if there are any perl modules which allow you to do
> something like (this is sort of a cross between cfengine and perl and
> pseudocode):
> 
> with <filename> {
> 	ReplaceAll /regex/ With "string"
> 	IF Exists Line "<line text>" AppendLine "<line text>"
> }
> 
> If cfengine sees this, it reads in the file mentioned in filename, and
> performs the listed transforms.

You probably want the 'cfperl' project, <http://lifelogs.com/cfperl/>,
which does this sort of thing in Perl.

> Anyway, are there any modules with this stuff built in?

Personally, I am starting to think that what *I* want is someone,
possibly me, to build a set of Perl modules that do the things that
cfengine does.

/That/ would be a fine thing for the world.  

     Daniel

-- 
The only place men want depth in a woman is in her décolletage.
        -- Zsa Zsa Gabor



More information about the Melbourne-pm mailing list