title: What is a shorthand way of displaying message and exiting on failure
body: <p>Is there a quick line to displaying a message and exit on error? I usually use a line like so</p>
  
  <pre><code>sudo apt-get install time-machine || exit -1
  </code></pre>
  
  <p>But If I add a print statement like so, it will exit every time (<code>apt-get</code> will fail, the <code>echo</code> statement is printed, then the <code>exit -1</code> statement is called). </p>
  
  <pre><code>sudo apt-get install time-machine || echo "Time Travel is Impossible" ; exit -1
  </code></pre>