#!/bin/bash
month=(07 07 07 07 07 07 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 08 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 09 10 10 10 10 10 10)
date=(26 27 28 29 30 31 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 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 01 02 03 04 05 06)
for ((i=1; i<6 ; i++));
do
j=i+1
export STRING=13"${month[i]}""${date[i]}"
export STRING1=13"${month[j]}""${date[j]}"
echo $STRING
echo $STRING1
cd /Library/WebServer/Documents/SEAC4RS-NA/conv_infl/
sed "s!Example!July ${date[i]}, 2013!" < convinflexample.html >tmp1
sed "s!018run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING}18_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp1 >tmp2
sed "s!018run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING}18_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp2 >tmp3
sed "s!10run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}00_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp3 >tmp4
sed "s!16run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}06_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp4 >tmp5
sed "s!112run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}12_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp5 >tmp6
sed "s!118run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}18_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp6 >tmp7
sed "s!10run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}00_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp7 >tmp8
sed "s!16run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}06_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp8 >tmp9
sed "s!112run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}12_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp9 >tmp10
sed "s!118run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}18_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp10 >"$STRING".html
rm tmp*
done 
for ((i=6; i<37 ; i++));
do
j=i+1
export STRING=13"${month[i]}""${date[i]}"
export STRING1=13"${month[j]}""${date[j]}"
echo $STRING
echo $STRING1
cd /Library/WebServer/Documents/SEAC4RS-NA/conv_infl/
sed "s!Example!August ${date[i]}, 2013!" < convinflexample.html >tmp1
sed "s!018run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING}18_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp1 >tmp2
sed "s!018run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING}18_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp2 >tmp3
sed "s!10run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}00_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp3 >tmp4
sed "s!16run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}06_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp4 >tmp5
sed "s!112run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}12_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp5 >tmp6
sed "s!118run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}18_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp6 >tmp7
sed "s!10run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}00_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp7 >tmp8
sed "s!16run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}06_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp8 >tmp9
sed "s!112run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}12_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp9 >tmp10
sed "s!118run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}18_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp10 >"$STRING".html
rm tmp*
done 
for ((i=37; i<67 ; i++));
do
j=i+1
export STRING=13"${month[i]}""${date[i]}"
export STRING1=13"${month[j]}""${date[j]}"
echo $STRING
echo $STRING1
cd /Library/WebServer/Documents/SEAC4RS-NA/conv_infl/
sed "s!Example!September ${date[i]}, 2013!" < convinflexample.html >tmp1
sed "s!018run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING}18_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp1 >tmp2
sed "s!018run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING}18_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp2 >tmp3
sed "s!10run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}00_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp3 >tmp4
sed "s!16run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}06_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp4 >tmp5
sed "s!112run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}12_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp5 >tmp6
sed "s!118run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}18_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp6 >tmp7
sed "s!10run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}00_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp7 >tmp8
sed "s!16run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}06_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp8 >tmp9
sed "s!112run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}12_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp9 >tmp10
sed "s!118run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}18_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp10 >"$STRING".html
rm tmp*
done 
for ((i=67; i<72 ; i++));
do
j=i+1
export STRING=13"${month[i]}""${date[i]}"
export STRING1=13"${month[j]}""${date[j]}"
echo $STRING
echo $STRING1
cd /Library/WebServer/Documents/SEAC4RS-NA/conv_infl/
sed "s!Example!October ${date[i]}, 2013!" < convinflexample.html >tmp1
sed "s!018run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING}18_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp1 >tmp2
sed "s!018run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING}18_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp2 >tmp3
sed "s!10run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}00_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp3 >tmp4
sed "s!16run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}06_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp4 >tmp5
sed "s!112run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}12_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp5 >tmp6
sed "s!118run50!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}18_NMC_AVN170L42_50_53_cldhist_traj_50kft.ps!" <tmp6 >tmp7
sed "s!10run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}00_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp7 >tmp8
sed "s!16run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}06_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp8 >tmp9
sed "s!112run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}12_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp9 >tmp10
sed "s!118run53!http://bocachica.arc.nasa.gov/SEAC4RS-NA/conf_infl/products/${STRING}/seac4rs_${STRING1}18_NMC_AVN170L42_50_53_cldhist_traj_53kft.ps!" <tmp10 >"$STRING".html
rm tmp*
done 
exit 0
