Skip to content

Instantly share code, notes, and snippets.

@kkawamura
Created June 14, 2013 07:34
Show Gist options
  • Save kkawamura/5780118 to your computer and use it in GitHub Desktop.
Save kkawamura/5780118 to your computer and use it in GitHub Desktop.
generate date list by shellscript
#!/bin/sh
start_date="20120601"
end_date="20120610"
i=0
while [ 1 ] ;do
now=`date +%Y%m%d -d "$start_date + $i days"`
echo $now
# command
if [ $now = $end_date ] ;then
break
fi
let i=$i+1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment