Skip to content

Instantly share code, notes, and snippets.

@farseerfc
Created February 7, 2012 09:43
Show Gist options
  • Save farseerfc/1758739 to your computer and use it in GitHub Desktop.
Save farseerfc/1758739 to your computer and use it in GitHub Desktop.
shell try
farseer ~ $ cat inner.sh
#!/bin/sh
echo $@
farseer ~ $ cat month_props.sh
#!/bin/sh
./inner.sh $@
echo `date`
farseer ~ $ cat try.sh
#!/bin/bash
fromDay="2010-1-1"
endDay="2012-1-1"
initSec=`date -d $fromDay +%s`
finiSec=`date -d $endDay +%s`
for (( i = $initSec ; i <= $finiSec ; i += 24 * 3600 ))
do
day=`date -d "1970-1-1 UTC $i seconds" +%F`
y=`date +%Y --date="$day"`
m=`date +%m --date="$day"`
d=`date +%d --date="$day"`
date=`date +%Y%m%d --date="$day"`
./month_props.sh $date
#echo $da
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment