title: Why exit code 141 with grep -q?
body: <p>Can someone explain why I get exit code 141 from the below? </p>
  
  <pre><code>#!/usr/bin/bash
  
  set -o pipefail
  
  zfs list | grep tank
  echo a ${PIPESTATUS[@]}
  
  zfs list | grep -q tank
  echo b ${PIPESTATUS[@]}
  
  cat /etc/passwd | grep -q root
  echo c ${PIPESTATUS[@]}
  </code></pre>
  
  <p>I get</p>
  
  <pre><code>...
  a 0 0
  b 141 0
  c 0 0
  </code></pre>
  
  <p>From my understanding exit code 141 is a failure, but the line above gives zero, so it should be success, I would say.</p>