Taking date and time of last 5 days
<p>I know that I can take date and time of yesterday by writing </p>

<pre><code>dt=`date +"%d-%m-%Y" -d "-1 day"`
</code></pre>

<p>Similarly I want to find -2 day, -3 day and so on. When I put this command in loop, and write it as</p>

<pre><code>dt=`date +"%d-%m-%Y" -d "-$i day"`
</code></pre>

<p>it didn't worked. Am I wrong somewhere or there is some another way to do such stuff.</p>