title: extract text between patterns - unix - AIX
body: <p>I want to extract text between two patterns. The command that I use doesn't work on AIX but works on linux.</p>
  
  <p>First, I look for the occurences of a pattern in a file and I have this</p>
  
  <pre><code>sed -n "/STEP 005450/p" step_100
  STEP 005450 ***ACTIVATED*** Thu Oct  5 17:31:05 CEST 2017
  STEP 005450 REF R-A493 STEP 000010 ( command  -s &lt;CONTAINER&gt; )
  STEP 005450 ***FAILURE*** Thu Oct  5 17:31:05 CEST 2017 Return code : 2
  STEP 005450 ***ACTIVATED*** Thu Oct  5 17:33:54 CEST 2017
  STEP 005450 REF R-A493 STEP 000010 ( command -s CONT1 )
  STEP 005450 ***SUCCESFUL*** Thu Oct  5 17:33:55 CEST 2017
  </code></pre>
  
  <p>Secondly, I want to extract the part of the text between <code>STEP 005450 ***ACTIVATED***</code> and <code>STEP 005450 ***FAILURE***</code>, but the command below doesn't work and does nothing.</p>
  
  <pre><code>sed -n "/STEP 005450/p" step_100 | sed -n "/STEP 005450/,/FAILURE/p"
  STEP 005450 ***ACTIVATED*** Thu Oct  5 17:31:05 CEST 2017
  STEP 005450 REF R-A493 STEP 000010 ( command  -s &lt;CONTAINER&gt; )
  STEP 005450 ***FAILURE*** Thu Oct  5 17:31:05 CEST 2017 Return code : 2
  STEP 005450 ***ACTIVATED*** Thu Oct  5 17:33:54 CEST 2017
  STEP 005450 REF R-A493 STEP 000010 ( command -s CONT1 )
  STEP 005450 ***SUCCESFUL*** Thu Oct  5 17:33:55 CEST 2017
  </code></pre>
  
  <p>Normally, I should have this</p>
  
  <pre><code>STEP 005450 ***ACTIVATED*** Thu Oct  5 17:31:05 CEST 2017
  STEP 005450 REF R-A493 STEP 000010 ( command  -s &lt;CONTAINER&gt; )
  STEP 005450 ***FAILURE*** Thu Oct  5 17:31:05 CEST 2017 Return code : 2
  </code></pre>
  
  <p>Thanks for tour help</p>