Using a variable with sed to return a section in an ini file

1

I need to use a defined variable in a script using sed to return the contents between section titles of an ini file. The code I've come up with works only with hard coded titles. I want to be able to insert any section title needed in the shell script (bash,ksh) using a function.

  function ()
{
    sed -n '/\[\CONFIG\]/,/\[/p' /PATH_TO_INI_FILE/__iniFile.ini | sed 's/\"//g' | grep -o '^[^[]*' > processingFile.txt
}

Carl

Posted 2019-11-29T20:37:55.917

Reputation: 11

No answers