help-cfengine
[Top][All Lists]
Advanced

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

Re: Need 'UncommentAndSetValue' or some such


From: Brendan Strejcek
Subject: Re: Need 'UncommentAndSetValue' or some such
Date: Thu, 27 Oct 2005 07:59:37 -0500
User-agent: Mutt/1.5.6+20040818i

Alexander Jolk wrote:

> Christopher Browne wrote:
> >I'd *love* to have something that would say something like...
> >
> >  AssignField LHS="com.foo.bar.jdbc.url"
> >              RHS="pgsql:$(dbhost):$(dbport):$(dbuser)"
> >              separator="="
> 
> Did someone consider code along the lines of
> SplitOn = ( = )
> SetLine "com.foo.bar.jdbc.url=pgsql:somehost:5432:user"
> ReplaceLinesMatchingField "1"
> ?

That assumes the line already exists. I think this does what most people
want:

    AppendIfNoSuchLine "com.foo.bar.jdbc.url=gak"
    SplitOn = ( = )
    SetLine "com.foo.bar.jdbc.url=pgsql:somehost:5432:user"
    ReplaceLinesMatchingField "1"

Also, since SplitOn must be a single character, it does not work for
assignments that use more than one character, such as " = " or ":=" .

Best,
Brendan

--
Senior System Administrator
The University of Chicago
Department of Computer Science
http://www.cs.uchicago.edu/people/brendan




reply via email to

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