title: Make grep succeed only if all patterns match
body: <p>I want to write a simple test that succeeds if all specified patterns are there in the output.</p>
  
  <p>Specifically I am testing if my program is correctly using a configuration file to configure itself. This worked fine when I only had one parameter, but now I am doing the same with multiple parameters and it seems like I need to go the less quick and dirty way now because grep succeeds if any of the pattern matches, instead of all of them.</p>
  
  <p>The program:</p>
  
  <pre><code>    logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "intParam is " &lt;&lt; get_parameters().intParam &lt;&lt; std::endl;
      logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "boolParam is " &lt;&lt; get_parameters().boolParam &lt;&lt; std::endl;
      logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "charParam is " &lt;&lt; get_parameters().charParam &lt;&lt; std::endl;
      logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "floatParam is " &lt;&lt; get_parameters().floatParam &lt;&lt; std::endl;
      logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "doubleParam is " &lt;&lt; get_parameters().doubleParam &lt;&lt; std::endl;
      logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "longParam is " &lt;&lt; get_parameters().longParam &lt;&lt; std::endl;
      logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "uintParam is " &lt;&lt; get_parameters().uintParam &lt;&lt; std::endl;
      logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "ulongParam is " &lt;&lt; get_parameters().ulongParam &lt;&lt; std::endl;
      logger_ &lt;&lt; yaaf::LogLevel::info &lt;&lt; "stringParam is " &lt;&lt; get_parameters().stringParam &lt;&lt; std::endl;
  </code></pre>
  
  <p>Current test:</p>
  
  <pre><code> timeout 3 ${ini_test} | grep 'intParam is 1'
  
   timeout 3 ${ini_test} -i ${workspace}/tests/eclipseProject/algos/testsIni/initest.ini | grep 'intParam is 2'
  </code></pre>
  
  <p>What does not work:</p>
  
  <pre><code>timeout 3 ${ini_test} | grep -e 'intParam is 1' -e 'boolParam is false' -e 'charParam is a' [and so on...]
  </code></pre>
  
  <p>does not work because grep will exit with code 0 if <strong>any</strong> of the pattern match. I want it to return 0 iff <strong>all</strong> patterns can be matched against the output.</p>
  
  <p>For this case I will probably just write some python code to do what I want, yet the case will probably present itself again in the future, or for someone else. How do I solve this problem?</p>