title: bash debugging using set -u
body: <p>I have a bash <strong><em>sourcedbash.sh</em></strong>  sourced in another bash main code <strong><em>main.sh</em></strong>.<br>
  Running <strong><em>main.sh</em></strong> with the "<em>set -u</em>" option, I'm getting an error than I can't figure out :</p>
  
  <pre><code>Error /sourced_bash.sh : line xx : variable without link  
  </code></pre>
  
  <p><strong><em>main.sh</em></strong></p>
  
  <pre><code>. sourced_bash.sh
  my_function $foomain 1
  </code></pre>
  
  <p><strong><em>sourcedbash.sh</em></strong></p>
  
  <pre><code>function my_function(){
     local foo=$1
     local bar=$2
     if [[ 1 -eq $bar ]];then # &lt;= this is LINE xx generating the error
          # ... dothis
          return 1
     elif [[ 0 -eq $bar ]];then
          # ... dothat
          return 0
     fi
  }
  </code></pre>
  
  <p>Looked into the man pages and reading "my friend" w/o a frank success.</p>
  
  <p>I'd need to understand why "<em>set -u</em>" implies the <strong><em>main.sh</em></strong> program aborption and how to get rid of this error (Debian Lenny).</p>
  
  <p>Thx in advance</p>