title: What is the proper way to test a Bash function's return value?
body: <p>I would like to test a Bash function's return value in an <em>if</em> statement like this:</p>
  <pre><code>if [[ func arg ]] ; then …
  </code></pre>
  <p>But I get error messages like: <code>conditional binary operator expected.</code></p>
  <p>What is the right way to do this?</p>
  <p>Is it the following?</p>
  <pre><code> if [[ $(func arg) ]] ; then ...
  </code></pre>