title: for loop / if condition in shell script
body: <p>I've never done shell script before and now I'm running into a simple problem...
  I have a for loop which executes every time the run.sh script. To see how far the script has already run I want to print e.g. every 5000 the actual index.</p>
  
  <pre><code>$counter = 0
  for ((  i = 0 ;  i &lt;= 5000;  i++  ))do
      if ($i =  $counter); then
              echo "$counter"
              counter=$(counter+1000)
      fi
  ./run.sh
  done
  </code></pre>
  
  <p>running this piece of code gives me the following error</p>
  
  <pre><code>./for_loop.sh: line 1: =: command not found
  ./for_loop.sh: line 3: 0: command not found
  </code></pre>
  
  <p>I have also tried to init the variable counter with</p>
  
  <pre><code>declare -i counter = 0
  </code></pre>
  
  <p>which gives me the following error</p>
  
  <pre><code>./for_loop.sh: line 1: declare: `=': not a valid identifier
  </code></pre>