title: How to pass config file section names as argument in shell script
body: <p>I want to pass the config file section name as a argument or parameter to .sh file.</p>
  
  <p>Can anyone please help me on this?</p>
  
  <p>Below is my shell script and a conf file.</p>
  
  <p>test.sh</p>
  
  <p><code>#!/bin/bash
      CONFIG=app.conf
      myuser=$(awk '/^\[user1\]/{f=1} f==1&amp;&amp;/^user/{print $3;exit}' "${CONFIG}")
      mypassword=$(awk '/^\[user2\]/{f=1} f==1&amp;&amp;/^password/{print $3;exit}' "${CONFIG}")
      echo $myuser
      echo $mypassword</code></p>
  
  <p>app.conf</p>
  
  <pre><code>[user1]
  user = root
  password = root123
  [user2]
  user = root2
  password = root123
  [user3]
  user = root3
  password = root12345
  </code></pre>
  
  <p>I want a script to be like when I run test.sh user2 It should print the variable values under the [user2] section.</p>
  
  <p>Please help me with this </p>