title: Bash arithmetic expansion with for loop
body: <p>I am trying to write a loop that uses command line arguments to determine the range over which it operates. As of now I've tried the following:</p>
  <pre><code>let a=$1
  let best=$2 
  for ((i=a ; i &lt; best ; i++)); do 
  let bwd_g = $((20 - i))
  echo $bwd_g 
  done 
  </code></pre>
  <p>when I call ./test.sh the following output is produced:</p>
  <pre><code>./test.sh: line 9: let: =: syntax error: operand expected (error token is &quot;=&quot;)
  </code></pre>
  <p>I've spent a large amount of time on coming up with different variants of this code but to no avail and have tried googling the error message.</p>