The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-05-2007
nhatch nhatch is offline
Registered User
  
 

Join Date: Aug 2002
Location: London, England
Posts: 85
Question Automate config changes

Hi All,

I have stooopidly agreed to automate our release process (which though easy is a pain).

The config file has a simple structure, below, each section can have upto 20 parms. The release doc will have the section name and parm to be changed.
What I want is to read the list of changes and then make the edit. I can do the auto edit (done before) I'm just struggling to do the find and read next line.

I'll find the section name and then read then next lot of lines, make the edits and do this until I find the next section name , where I start the edits again.
I'm finding the section based on the "^[" but I'm not sure how to continue the read assuming the ^ not equal to ^[. Any ideas?????

[Section1]
parm=value
parm2=value
parm3=value
[Section2]
parm=value
parm2=value
parm3=value