title: "let" command is not found in my bash script
body: <p>I have the following bash script,</p>
  
  <pre><code>#!/bin/bash
  echo $SHELL
  
  i=1
  for img in ../img/*.png; do
    echo $img
    new=$(printf "../img/tmp/pyr%d.png" "$i")
    echo $new
    # cp "$img" "$new"
    let i=i+1
  done
  # avconv -r 2  -i ../img/tmp/pyr%d.png -b:v 1000k ../pop_pyr.mp4
  </code></pre>
  
  <p>In the <code>../img</code> folder, there are files <code>pyr1920.png</code>, <code>pyr1925.png</code>, ...</p>
  
  <p>When I run this script, I get this error</p>
  
  <pre><code>../img/pyr1920.png
  ../img/tmp/pyr1.png
  make_video.sh: 10: make_video.sh: let: not found
  ../img/pyr1925.png
  ../img/tmp/pyr1.png
  </code></pre>
  
  <p>But I pasted the script in a terminal, it works perfectly fine.</p>
  
  <pre><code>../img/pyr1920.png
  ../img/tmp/pyr1.png
  ../img/pyr1925.png
  ../img/tmp/pyr2.png
  </code></pre>
  
  <p>My environment it ubuntu 14.04. I understand that default /bin/sh is dash. I make sure to use bash and check by <code>echo $SHELL</code>.</p>
  
  <p>Why it doesn't work as a script but works fine from a terminal? I tried to find a solution but all I can find is about "dash" and "bash" setting.</p>