Guest User

Untitled

a guest
May 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #!/bin/bash
  2. i=0
  3. thedate="2018-03-28"
  4. enddate="2018-04-02"
  5. while [ "$thedate" != "$enddate" ]; do
  6. thedate=$( date -d "$thedate + $i days" +%F )
  7.  
  8. new_date=$( date -d "$thedate " +%Y%m%d )
  9. printf 'The date is "%s"n' "$new_date"
  10. i=$(( i + 1 ))
  11. done
  12.  
  13. The date is "20180328"
  14. The date is "20180329"
  15. The date is "20180330"
  16. The date is "20180331"
  17. The date is "20180401"
  18. The date is "20180402"
Add Comment
Please, Sign In to add comment