title: Sed insert line multiple times on pattern
body: <p>I have</p>
  
  <pre><code>/var/log/syslog
  {
      rotate 7
      daily
      missingok
      notifempty
      delaycompress
      compress
      postrotate
          invoke-rc.d rsyslog rotate &gt; /dev/null
      endscript
  }
  
  /var/log/mail.info
  /var/log/mail.warn
  /var/log/mail.err
  /var/log/mail.log
  /var/log/daemon.log
  /var/log/kern.log
  /var/log/auth.log
  /var/log/user.log
  /var/log/lpr.log
  /var/log/cron.log
  /var/log/debug
  /var/log/messages
  {
      rotate 4
      weekly
      missingok
      notifempty
      compress
      delaycompress
      sharedscripts
      postrotate
          invoke-rc.d rsyslog rotate &gt; /dev/null
      endscript
  }
  </code></pre>
  
  <p>What I want to do is insert <code>olddir /var/log/oldlog</code> a line before the top <code>rotate 7</code> and lower <code>rotate 4</code> lines.
  Is it possible to make <code>sed</code> do possible multiple insertions?
  Also it also needs to ignore the <code>rotate &gt;</code> pattern in the postrotate.</p>
  
  <p>I thought I would ask before I try and do something longwinded and horrid.
  Also the above is the main question but a secondary one would be to iterate all files in the directory with the above.</p>
  
  <p>Any pointers would be really appreciated  </p>