title: How to replace a line with multiple lines in multiline format?
body: <p>There is a similar question on SO, however, the provided answer is all done in one line. For readability purposes I would like the solution on multiple lines:</p>
  
  <p>This is what I tried although as append:</p>
  
  <pre><code>sed -i '/home_server localhost {/a\
  home_server example-coa {\
          type = coa\
          ipaddr = 127.0.0.1\
          port = 3799\
          secret = '"${SECRET}"'\
          coa {\
                  irt = 2\
                  mrt = 16\
                  mrc = 5\
                  mrd = 30\
          }\
  }\
  home_server localhost {\
  ' /etc/freeradius/3.0/proxy.conf
  </code></pre>
  
  <p>This is an example of APPEND, it works, but I need to do a replace.
  I would like to replace <code>home_server localhost {</code> with the above.</p>
  
  <p>I'm literally trying to add a block above it so that it will look like this at the end:</p>
  
  <pre><code>home_server example-coa {
  ...
  }
  home_server localhost {
  ...
  }
  </code></pre>