I have config file like this:
server_name xx opt1 opt2 opt3
suboptions1
#suboptions - disabled
suboptions2 pattern
suboptions3
server_name yy opt1 opt2 opt3
suboptions1 pattern
#suboptions - disabled
suboptions2
So basically I want to extract the server name together with just options/pattern like i.e. suboptions2 but just in range from server to server section like sed '/start/,/end/' file.cfg but just for suboptions which doesn't match some pattern and also exlucde servernames for those. Thank you.