Skip to content

Instantly share code, notes, and snippets.

@tanji
Created June 10, 2015 14:08
Show Gist options
  • Save tanji/c6735f52eb6f891c6956 to your computer and use it in GitHub Desktop.
Save tanji/c6735f52eb6f891c6956 to your computer and use it in GitHub Desktop.
Date sequence generator
#!/bin/bash
if [ -z $1 ]
then
echo "example usage: $(basename $0) 20150401 20150530"
exit 1
fi
date=$1
while true
do
echo $date
if [ $date == $2 ]
then
break
fi
date=$(date +%Y%m%d --date="$date +1 day")
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment