title: Subprocess.check_output with grep: exit-status 2
body: <p>I've used subprocess before without any problems, for some reason when I try it with grep:</p>
  
  <pre><code>grepOut = subprocess.check_output("grep 'hello' tmp", shell=True)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
      raise CalledProcessError(retcode, cmd, output=output)
  subprocess.CalledProcessError: Command '['grep', "'hello'", 'tmp']' returned non-zero exit status 2
  </code></pre>
  
  <p>I don't get any errors by typing the command directly in a terminal.</p>
  
  <p>EDIT: see clemej's answer for the explanation</p>