help-cfengine
[Top][All Lists]
Advanced

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

Re: non-convergent file edit?


From: rader
Subject: Re: non-convergent file edit?
Date: Wed, 17 Mar 2004 05:27:07 -0600

 > > From: me
 > > editfiles:
 > >   { /etc/motd 
 > >       ReplaceOnce "year is [[:digit:]]{4}" With "year is $(year)" }
 
 > From: Jamie Wilkinson
 > editfiles:
 > 
 >    { /etc/motd
 >        LocateLineMatching "year is [[:digit:]]{4}"
 >        ReplaceLineWith "year is $(year)
 >    }
 > 
 > If your script is convergent it will only happen once anyway.

Sorry, doesn't work for me.  In perl terms, I want...

 s/year is \d{4}/year is $year/

or more verbosely...
 
 s/^(.*?)year is \d{4}(.*)$/${1}year is ${year}${2}/

I tested what you have above, and I seem to recall that 
it's equivalant of...

 s/^(.*?)year is \d{4}(.*)$/year is $year/

or maybe just... 

 s/^year is \d{4}$/year is $year/

steve 
- - - 
systems & network guy
high energy physics
university of wisconsin





reply via email to

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