title: Iterate through a file until match and find a second, different match, until no match. Repeat until EOF
body: <p>Hi I have a fairly large but messy output from a salt script I'm running.</p>
  
  <p>Basically my cleanest output looks like this:</p>
  
  <pre><code>MINION:server1.xyz.com
  MINION:server2.xyz.com
  MINION:server3.xyz.com
  filer1:/vol/storagestuffs/volpath1
  filer1:/vol/storagestuffs/volpath2
  filer1:/vol/storagestuffs/volpath3
  filer1:/vol/storagestuffs/volpath4
  MINION:server4.xyz.com
  filer4:/vol/storagestuffs/volpath1
  MINION:server5.xyz.com
  MINION:server6.xyz.com
  MINION:server7.xyz.com
  filer3:/vol/storagestuffs/volpath1
  </code></pre>
  
  <p>What I want is ONLY to return the minions that have filers beneath them and all of the filers beneath them and I'd like to get it formatted as such:</p>
  
  <pre><code>MINION:server3.xyz.com filer1:/vol/storagestuffs/volpath1 
  MINION:server3.xyz.com filer1:/vol/storagestuffs/volpath2
  MINION:server3.xyz.com filer1:/vol/storagestuffs/volpath3
  MINION:server3.xyz.com filer1:/vol/storagestuffs/volpath4
  MINION:server4.xyz.com filer4:/vol/storagestuffs/volpath1
  MINION:server7.xyz.com filer3:/vol/storagestuffs/volpath1
  </code></pre>
  
  <p>I've looked into if statements, recursive statements, etc.  I either am failing to understand bash recursive statements or thats not what I want to do.  I'm hoping to find an efficient way of doing this without scanning the file more than once.</p>
  
  <p>Is there a tricky way to use xargs?  Is there something in grep that can do this?</p>
  
  <p>Thanks for any help!</p>