[Top][All Lists]

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

Re: editfiles complexity

From: Systems Administrator
Subject: Re: editfiles complexity
Date: Tue, 20 Jan 2004 10:42:26 +1100 (EST)

On Mon, 19 Jan 2004, Holger Schurig wrote:

> > There is room to rethink this in something
> > like the way that you say.
> Another are where I want to raise awareness is the level of the editfiles.
> For me, the lowest level would just know about flat files.
> The next level knows about various forms of comments.
> One level higher we would know about various formats of files. For example:
>   flat

        By this, do you mean line-based?

>   shell-like


>   ISC-format (like for dhcpd.conf or various Debian Utilities
>   Apache-like
>   INI-File (like all the KDE stuff)

        There are two more, which are already used in cfengine to a
certain extent:
delimited (passwd, etc)

        However, it would be cool if the SplitOn variable was maybe a Perl
Regex (cf pcre library).  That would make it easier to split on whitespace
(like /etc/fstab -- just specify spliton = ( "\s+" ) ).

        Rather than programming in each config file format, though, it
might be better to somehow specify the format.  For example, ISC, Apache
and INI files could all have defined start and end blocks (ini ends at the
start of the next block, so no nesting).  Then you could specify each line
format.  Apache and ISC would both be whitespace delimited, whereas INI
would be '=' delimited, with a max of 2 per line.  Apache and INI both use
\n as the "line ender", whereas ISC uses ';'.

        You could also use some intelligence to guess what kind of file it
is.  eg. /etc/fstab is known.  So is Apache.  Or maybe not -- that might
be too dangerous :).


Tim Nelson
Systems Administrator
Sunet Internet
Tel: +61 3 5241 1155
Fax: +61 3 5241 6187
Email: address@hidden

reply via email to

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