title: How does && work in shell?
body: <p>I'm using <code>Bash</code> specifically, but I imagine most shells behave the same way.</p>
  
  <p>I often do</p>
  
  <pre><code>hg pull &amp;&amp; hg update --clean
  </code></pre>
  
  <p>But it just occurred to me, if <code>hg pull</code> returns <code>0</code> on success, why does it execute the <code>hg up</code> command?</p>
  
  <p>Typically the way the <code>&amp;&amp;</code> operator works is that it will only execute the next argument if the previous one was truthy. Is <code>0</code> truthy in Bash, or what?</p>
  
  <p>This came up because I tried doing the equivalent in Python, but I had to write it like this:</p>
  
  <pre><code>call(['hg','pull']) or call(['hg','update','--clean'])
  </code></pre>