title: setting global variable in bash
body: <p>I have function where I am expecting it to hang sometime. So I am setting one global variable and then reading it, if it didn't come up after few second I give up. Below is not complete code but it's not working as I am not getting $START as value 5</p>
  
  <pre><code>START=0
  ineer()
  {
      sleep 5
      START=5
      echo "done $START"   ==&gt; I am seeing here it return 5
      return $START
  }
  echo "Starting"
  ineer &amp;
  
  while true
  do
      if [ $START -eq 0 ]
      then
          echo "Not null $START"  ==&gt; But $START here is always 0
      else
          echo "else $START"
          break;
      fi
      sleep 1;
  done
  </code></pre>