title: Return a single value from a shell script function
body: <p>Example:</p>
  
  <pre><code>#!/bin/sh
  
  a() {
  R=f
  ls -1 a*
  [ "$?" == "1" ] &amp;&amp; { R=t; }
  echo $R
  }
  
  r=`a`
  echo $r
  </code></pre>
  
  <p><code>$r</code> contains <code>t</code> or <code>f</code> but also the output of the <code>ls</code> command. </p>
  
  <p>I may write <code>ls -1 a* &gt;/dev/null 2&gt;/dev/null</code>, but if there is a more complex script that can be lead to errors. </p>
  
  <p>Is there any way to return a single value from <code>a()</code> ?</p>