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


_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine

Reply via email to