[lug] Publishing config files

Daniel Webb lists at danielwebb.us
Fri Nov 11 18:49:50 MST 2005


On Fri, Nov 11, 2005 at 06:33:56PM -0700, David L. Anselmi wrote:

> I hate having to change the same thing in more than one place.  So you 
> might do something like:
> 
> ; !!!REPLACE:XXXXX:12345
> exten = XXXXX,1,SetCIDNum(1112223333)
> exten = XXXXX,2,SetCIDName(Someone)
> exten = XXXXX,3,Goto(calling_card,s,1)
> 
> and then run the script two ways: one way to replace the Xs with the 
> real value for use, and another to just remove the REPLACE lines for 
> publishing.  Perhaps REPLACE:<place holder>:<real value>:<fake value> 
> would be easier to code but you get the idea.

I like that approach.  I could just run 

$ perl -i -p -e 's/!!!REPLACE//' <file>

on each file after your previous Perl program.



More information about the LUG mailing list