Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- i=0
- thedate="2018-03-28"
- enddate="2018-04-02"
- while [ "$thedate" != "$enddate" ]; do
- thedate=$( date -d "$thedate + $i days" +%F )
- new_date=$( date -d "$thedate " +%Y%m%d )
- printf 'The date is "%s"n' "$new_date"
- i=$(( i + 1 ))
- done
- The date is "20180328"
- The date is "20180329"
- The date is "20180330"
- The date is "20180331"
- The date is "20180401"
- The date is "20180402"
Add Comment
Please, Sign In to add comment