Created
September 15, 2016 00:57
-
-
Save b0n/c4ae8e3ba2582e9bb405318832b78ac3 to your computer and use it in GitHub Desktop.
Add 1day one by one with bash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
START_DATE="20150801" | |
END_DATE="20150826" | |
echo ${START_DATE}; | |
echo ${END_DATE} | |
for (( DATE=${START_DATE}; ${DATE} < ${END_DATE}; DATE=`date -d "${DATE} 1 day" '+%Y%m%d'` )) ; do | |
echo ${DATE} | |
DATE2=`date -d "${DATE}" '+%Y-%m-%d'` | |
echo ${DATE2} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment