title: How to print out line found and line after line found in bash shell script?
body: <p>I have a .txt file that prints out hundreds of lines of text that are the results of many test. At the beginning of the test it says</p>
  
  <p>LAUNCH TEST: {nameOfTest}.</p>
  
  <p>Then proceeds to print out which test passed and which failed. At the end of test it prints out</p>
  
  <p>============================================
  Ran 3 tests in 0.000 seconds, 3 successes, 0 failures</p>
  
  <p>These are two lines in the .txt files. What I want to do print out the LAUNCH TEST and the results of the test.</p>
  
  <p>I know I can iterate over every line of the txt file like so:</p>
  
  <pre><code>cat ~/sample.txt | while read line; do
      #Then compare "$line" with what I am searching for
  </code></pre>
  
  <p>So the question is how do I search for lines "containing" certain string then print it?</p>
  
  <p>Something like,</p>
  
  <pre><code>if [[ "$line" == *"LAUNCH TEST"* ]]; then
              echo $line
              echo "This was the test found"
      fi
  </code></pre>
  
  <p>But for some reason this comparison does not work inside of that while loop.</p>