Skip to content

Instantly share code, notes, and snippets.

@R3TSU

R3TSU/date_loop.sh

Forked from chluehr/date_loop.sh
Created May 16, 2018
Embed
What would you like to do?
Bash: Loop over dates
#!/bin/bash
now=`date +"%Y-%m-%d" -d "05/06/2012"`
end=`date +"%Y-%m-%d" -d "05/23/2012"`
while [ "$now" != "$end" ] ;
do
now=`date +"%Y-%m-%d" -d "$now + 1 day"`;
echo $now
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment