title: Assign variable inside for loop
body: <p>I'm trying to do a simple for{} loop and I encountered problem with assign a variable inside loop. I will try to explain it on example:</p>
  
  <pre><code>DIFF=(`date +%s -d 20120203`-`date +%s -d 20120126`)/86400   # Difference between 2 dates.
  echo $DIFF
  end_date_change='20120126'
  
  for i in {1..$DIFF}   #Difference between 2 dates inside loop
  do
  end_date_change=$(end_date_change -d "-1 day")  # Now, after every loop I would like to decrease date
  echo $end_date_change
  done
  </code></pre>
  
  <p>So the output should looks:</p>
  
  <pre><code>20120126
  20120127
  20120128
  20120201
  20120202
  20120203
  </code></pre>
  
  <p>Anyone? Thanks in advance</p>