title: Edit file in unix using SED
body: <p>I have file1.txt in UNIX as following</p>
  
  <pre><code>[Section A]
  $param1=value1
  $param2=value2
  
  [Section B]
  $param1=value1
  $param2=value2
  $param3=value3
  </code></pre>
  
  <p>I want to edit value2 in Section B to be <strong>new_value2</strong> programmatically</p>
  
  <pre><code>[Section A]
  $param1=value1
  $param2=value2
  
  [Section B]
  $param1=value1
  $param2=new_value2
  $param3=value3
  </code></pre>
  
  <p>Any idea what should be the unix command to do this (using sed?)?</p>
  
  <p>Thanks a lot.</p>