#!/bin/bash 
DATES=(13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 01 02 03 04)
MONTH=(09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 11 11 11 11)
YEAR=(2016)
YY=(16)
MONTHNAME=(September September September September September September September September September September September September September September September September September September October October October October October October October October October October October October October October October October October October October October October October October October October October October October October October October November November November November)
for ((i = 27 ; i < (${#DATES[@]}-4) ; i++)) ;
do
STRING=${YY}${MONTH[i]}${DATES[i]}
STRING00=${STRING}00
STRING12=${STRING}12
echo $STRING
cd /Library/WebServer/Documents/POSIDON/met_html/fvg/
sed "s!Example!${MONTHNAME[i]} ${DATES[i]}, ${YEAR}!" < ../example_fvg.html >tmp1
sed "s!Date1!${MONTHNAME[i-1]} ${DATES[i-1]}, ${YEAR}!" <tmp1 >tmp46
sed "s!Date2!${MONTHNAME[i-2]} ${DATES[i-2]}, ${YEAR}!" <tmp46 >tmp47
sed "s!Date3!${MONTHNAME[i-3]} ${DATES[i-3]}, ${YEAR}!" <tmp47 >tmp48
sed "s!Date4!${MONTHNAME[i-4]} ${DATES[i-4]}, ${YEAR}!" <tmp48 >tmp49
sed "s!Date5!${MONTHNAME[i-5]} ${DATES[i-5]}, ${YEAR}!" <tmp49 >tmp50
sed "s!Date6!${MONTHNAME[i-6]} ${DATES[i-6]}, ${YEAR}!" <tmp50 >tmp51
sed "s!Date7!${MONTHNAME[i-7]} ${DATES[i-7]}, ${YEAR}!" <tmp51 >tmp52
sed "s!link1!met_html/fvg/${YY}${MONTH[i-1]}${DATES[i-1]}.html!" <tmp52 >tmp53
sed "s!link2!met_html/fvg/${YY}${MONTH[i-2]}${DATES[i-2]}.html!" <tmp53 >tmp54
sed "s!link3!met_html/fvg/${YY}${MONTH[i-3]}${DATES[i-3]}.html!" <tmp54 >tmp55
sed "s!link4!met_html/fvg/${YY}${MONTH[i-4]}${DATES[i-4]}.html!" <tmp55 >tmp56
sed "s!link5!met_html/fvg/${YY}${MONTH[i-5]}${DATES[i-5]}.html!" <tmp56 >tmp57
sed "s!link6!met_html/fvg/${YY}${MONTH[i-6]}${DATES[i-6]}.html!" <tmp57 >tmp58
sed "s!link7!met_html/fvg/${YY}${MONTH[i-7]}${DATES[i-7]}.html!" <tmp58 >tmp59
sed "s!tf12000!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING00}/T_press_120_fvg_${STRING}00.html!" <tmp59 >tmp350
sed "s!tf12012!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING12}/T_press_120_fvg_${STRING}12.html!" <tmp350 >tmp352
sed "s!tf120zm00!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING00}/T_press_120_fvg_zm_${STRING}00.html!" <tmp352 >tmp353
sed "s!tf120zm12!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING12}/T_press_120_fvg_zm_${STRING}12.html!" <tmp353 >tmp354
sed "s!tf10000!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING00}/T_press_100_fvg_${STRING}00.html!" <tmp354 >tmp356
sed "s!tf10012!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING12}/T_press_100_fvg_${STRING}12.html!" <tmp356 >tmp357
sed "s!tf100zm00!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING00}/T_press_100_fvg_zm_${STRING}00.html!" <tmp357 >tmp358
sed "s!tf100zm12!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING12}/T_press_100_fvg_zm_${STRING}12.html!" <tmp358 >tmp359
sed "s!tf8500!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING00}/T_press_85_fvg_${STRING}00.html!" <tmp359 >tmp360
sed "s!tf8512!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING12}/T_press_85_fvg_${STRING}12.html!" <tmp360 >tmp361
sed "s!tf85zm00!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING00}/T_press_85_fvg_zm_${STRING}00.html!" <tmp361 >tmp362
sed "s!tf85zm12!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING12}/T_press_85_fvg_zm_${STRING}12.html!" <tmp362 >tmp363
sed "s!tf7300!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING00}/T_press_73_fvg_${STRING}00.html!" <tmp363 >tmp364
sed "s!tf7312!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING12}/T_press_73_fvg_${STRING}12.html!" <tmp364 >tmp365
sed "s!tf73zm00!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING00}/T_press_73_fvg_zm_${STRING}00.html!" <tmp365 >tmp366
sed "s!tf73zm12!http://bocachica.arc.nasa.gov/POSIDON/met_files/fvg/${STRING12}/T_press_73_fvg_zm_${STRING}12.html!" <tmp366 >"${STRING}.html"
rm tmp*
done 
exit 0
