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 UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-04-2008
potro's Avatar
potro potro is offline
Registered User
 

Join Date: Mar 2008
Posts: 36
Handle Configuration File with same name of Parameter in multiple Sections

Hi

I have a config file with multiple section and a parameter with the same name in each section. I need to read each parameter for distinct section.

[Section1]
Parameter = 1
....
[Section2]
Parameter = 2
....
[Section3]
Parameter = 4
....

Tried this:
grep -m1 '^[^#][:space:]*ProcessorsNumber' ServiceBrokerFramework.cfg | awk -F" = " '{print $2}'

but the output is only the first occurence found in the config file.

Thanks,
Bianca
Reply With Quote
Forum Sponsor