title: Comment multiple lines in a file using sed
body: <p>I am working on MAC OSX. I am writing shell script to add prefix "//" to all the log messages in a file. I wrote the following sed script:</p>
  
  <pre><code>    sed -i '' "s|"log+*"|"//log"|g" filename
  </code></pre>
  
  <p>The script is working fine when the log message has single line. But if the log has multiple lines it fails. eg:</p>
  
  <pre><code>    log("hi
           how are
           you");
  </code></pre>
  
  <p>the output for this comes out to be :</p>
  
  <pre><code>    //log("hi
             how are
             you");
  </code></pre>
  
  <p>But, I want the output to be:</p>
  
  <pre><code>    //log("hi
      //     how are
      //     you");
  </code></pre>
  
  <p>Since I haven't used sed much I don't know how to do this. So, Is it possible to do this using sed. If yes how?</p>
  
  <p>Thanks</p>