title: Replace a line with multiple lines in a file
body: <p>I want to replace a single line in a file with multiple lines, e.g., I want to replace a particular function call, say,</p>
  
  <pre><code>foo(1,2)
  </code></pre>
  
  <p>with </p>
  
  <pre><code>if (a &gt; 1) {  
      foo(1,2)  
  } else {  
      bar(1,2)  
  }
  </code></pre>
  
  <p>How can I do it in bash?</p>