title: arithmetic on bash function return value without accessing $?
body: <p>I am a green hand for shell scripting.</p>
  <p>I wonder can we do something like this:</p>
  <pre><code>a=$((func arg))
  </code></pre>
  <p>to have it mean:</p>
  <pre><code>func arg
  a=$?
  </code></pre>
  <p>I am struggling to understand what kind of arithmetic can we put on function return value?</p>
  <p>Is function return value an expression of int type?</p>
  <p>I see people do <code>! func arg</code>. Why <code>!func arg</code> doesn't work? Aside from <code>!</code>, what other operation can be used in this way? I am especially interested in comparison operator.</p>
  <p>How to do something like this in one liner?</p>
  <pre><code>if [ (fun arg) -eq some_random_int_literal] 
  </code></pre>
  <p>Thanks!</p>