title: Problem generating timestamps in a loop in Bash
body: <p>When I run the command: </p>
  
  <pre><code>timestamp=$(date+"%s") ; echo "$timestamp"
  </code></pre>
  
  <p>there is no error.</p>
  
  <p>However when I try to run it in a loop like:</p>
  
  <pre><code>while [  $COUNTER -lt 10 ]; do  ts=$(date+"%s") ; echo "$ts" ; let COUNTER=COUNTER+1 ;  done  
  </code></pre>
  
  <p>"-bash: date+%s: command not found" error is thrown. Why?</p>