title: Pipe output through a bash or, double pipe, || expression?
body: <p>I have a noisy command whose output I want to hide on success. However, in a failure case, that output might prove helpful for debugging, so I want to show it before printing my error message.</p>
  
  <p>Currently, I do it this way:</p>
  
  <pre><code>OUTPUT=$( cmd1 2&gt;&amp;1 ) || {
    echo $OUTPUT
    echo cmd1 failed
    exit 1
  }
  </code></pre>
  
  <p>Is it possible to pipe <code>cmd1</code>'s output through the <code>||</code> (or, double-pipe) so I can avoid creating a variable for the output?</p>