title: How does AND and OR operators work in Bash?
body: <p>I tried the following command on bash</p>
  <pre><code>echo this || echo that &amp;&amp; echo other
  </code></pre>
  <p>This gives the output</p>
  <pre><code>this
  other
  </code></pre>
  <p>I didn't understand that!</p>
  <p>My dry run goes this way :</p>
  <ol>
  <li><code>echo this || echo that &amp;&amp; echo other</code> implies <code>true || true &amp;&amp; true</code></li>
  <li>Since, <code>&amp;&amp;</code> has <code>more precedence</code> than <code>||</code>, the second expression evaluates first</li>
  <li>Since, <code>both are true</code>, the <code>||</code> is evaluated which also gives true.</li>
  <li>Hence, I conclude the output to be:</li>
  </ol>
  <blockquote>
  <p>that</p>
  <p>other</p>
  <p>this</p>
  </blockquote>
  <p>Being from a Java background where <code>&amp;&amp;</code> has more precedence than <code>||</code>, I am not able to relate this to bash.</p>
  <p>Any inputs would be very helpful!</p>