title: Multiline pattern matching in bash
body: <p>I have a long file of the type</p>
  
  <pre><code>Processin SCRIPT10 file..
  Submitted batch job 1715572
  Processin SCRIPT100 file..
  Processin SCRIPT1000 file..
  Submitted batch job 1715574
  Processin SCRIPT10000 file..
  Processin SCRIPT10001 file..
  Processin SCRIPT10002 file..
  Submitted batch job 1715577
  Processin SCRIPT10003 file..
  Submitted batch job 1715578
  Processin SCRIPT10004 file..
  Submitted batch job 1715579
  </code></pre>
  
  <p>I want to find out jobs (script names) that were not submitted. That means there is not line submitted batch job right after processing line.</p>
  
  <p>So far I have tried to do that task using</p>
  
  <pre><code>pcregrep -M "Processin.*\n.*Processin" execScripts2.log | awk 'NR % 2 == 0'
  </code></pre>
  
  <p>But it does not handle properly the situation when multiple scripts does not get processed. It outputs, surprisingly, only SCRIPT1000 and SCRIPT10001 lines. Can you show me a better one-liner?</p>
  
  <p>Ideally the output would be only the lines without 'Submitted' on the next line (or just script names) that means:</p>
  
  <pre><code>SCRIPT100
  SCRIPT10000
  SCRIPT10001
  </code></pre>
  
  <p>Thanks.</p>