title: sed delete multi lines after a match then do replace
body: <p>I have a file <code>/etc/config/network</code></p>
  <pre><code>config interface loopback
          option ifname   lo
          option proto    static
          option ipaddr   127.0.0.1
          option netmask  255.0.0.0
  
  config interface lan
          option ifname   eth0
          option type     none
          option proto    static
          option ipaddr   192.168.1.1
          option netmask  255.255.255.0
  
  config interface debug
          option ifname   usb0
          option type     none
          option proto    static
          option ipaddr   172.18.0.18
          option netmask  255.255.255.0
  </code></pre>
  <p>I want to rewrite it to be</p>
  <pre><code>config interface loopback
      option ifname   lo
      option proto    static
      option ipaddr   127.0.0.1
      option netmask  255.0.0.0
  
  config interface lan
      option ifname   eth0
      option type     none
      option proto    dhcp
  
  config interface debug
      option ifname   usb0
      option type     none
      option proto    static
      option ipaddr   172.18.0.18
      option netmask  255.255.255.0
  </code></pre>
  <p>I proceed this in this way:</p>
  <ol>
  <li>find <code>static</code> then delete two lines after(exclude line <code>static</code>)</li>
  <li>replace <code>static</code> with <code>dhcp</code></li>
  </ol>
  <p>Tried using <code>sed '/static/{n;d}' /etc/config/network | sed -e 's/static/dhcp/' -e '/dhcp/{n;d}' &gt; /etc/config/network</code> which is not so neat.</p>
  <p>Could this be like <code>sed -i -e &lt;delete pattern&gt; -e &lt;replace pattern&gt; /etc/config/network</code> ?</p>