makeyear.sh

 

### makeyear.sh
###
### Create skeleton of current month
### Used for status reports.  See cal.html
###

if [ "$1" = "" ]
then
    echo "Usage: makeyear.sh YYYY"
    exit 1
else
    xyear=$1
fi

for i in `echo 1 2 3 4 5 6 7 8 9 10 11 12`
do

    case $i in
       1) zmonth="Jan" ;;
       2) zmonth="Feb" ;;
       3) zmonth="Mar" ;;
       4) zmonth="Apr" ;;
       5) zmonth="May" ;;
       6) zmonth="Jun" ;;
       7) zmonth="Jul" ;;
       8) zmonth="Aug" ;;
       9) zmonth="Sep" ;;
       10) zmonth="Oct" ;;
       11) zmonth="Nov" ;;
       12) zmonth="Dec" ;;
    esac


    cal $i $xyear > tmp.out
    csplit tmp.out 2

    echo "<p><hr>" > $i.html
    sed "s/^/<h3>/g" xx00 | \
    sed "s/$/<\/h3>/g">> $i.html

    echo "<table cellpadding=1>" >> $i.html

    grep -v "^$" xx01 | \
    sed "s/ $//g"  | \
    sed "s/    /xxx/g"  | \
    sed "s/  / /g"  | \
    sed "s/^ //g"  | \
    sed "s/^/<tr><td>/g"  | \
    sed "s/$/<\/td><\/tr>/g"  | \
    sed "s/xxx/ /g"  | \
    sed "s/ /<\/td><td>/g" | \
    sed "s/<td>/<td align=right>/g" >> $i.html


    echo "</table>" >> $i.html

    for x in `echo 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31`
    do
        sed "s/>$x</><a href=\"${zmonth}_${x}.html\">$x<\/a></" $i.html > $i.tmp
        mv $i.tmp $i.html
    done
    

done

echo "<html>" > $xyear.html
echo "<head><title>$file</title>" >> $xyear.html
echo "<meta content=text/css http-equiv=Content-Style-Type>" >> $xyear.html
echo "<link href=\"http://www.setgetweb.com/black.css\" rel=stylesheet type=text/css>" >> $xyear.html 
echo "</head>" >> $xyear.html
echo "<body>" >> $xyear.html
echo "<font class=grey2>" >> $xyear.html
echo "<blockquote>" >> $xyear.html
echo "<blockquote>" >> $xyear.html
echo "<p>&nbsp;</p>" >> $xyear.html
echo "<center><h1>$file</h1></center>" >> $xyear.html
echo "<p>&nbsp;</p>" >> $xyear.html
echo "<p><table cellpadding=10>" >> $xyear.html

echo "<tr>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 1.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 2.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 3.html >> $xyear.html
echo "</td>" >> $xyear.html

echo "</tr>" >> $xyear.html
echo "<tr>" >> $xyear.html

echo "<td valign=top>" >> $xyear.html
cat 4.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 5.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 6.html >> $xyear.html
echo "</td>" >> $xyear.html

echo "</tr>" >> $xyear.html
echo "<tr>" >> $xyear.html

echo "<td valign=top>" >> $xyear.html
cat 7.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 8.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 9.html >> $xyear.html
echo "</td>" >> $xyear.html

echo "</tr>" >> $xyear.html
echo "<tr>" >> $xyear.html

echo "<td valign=top>" >> $xyear.html
cat 10.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 11.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "<td valign=top>" >> $xyear.html
cat 12.html >> $xyear.html
echo "</td>" >> $xyear.html
echo "</tr>" >> $xyear.html
echo "<table>  " >> $xyear.html
echo "<center>  " >> $xyear.html
echo "<p><hr>" >> $xyear.html
echo "<p>&nbsp;</p>" >> $xyear.html
echo "<p>&nbsp;</p>" >> $xyear.html
echo "<script javascript=\"JavaScript\"> " >> $xyear.html
echo "    document.write(\"<br>Last updated: \"+document.lastModified); " >> $xyear.html
echo "</script> " >> $xyear.html
echo "</blockquote>" >> $xyear.html
echo "</blockquote>" >> $xyear.html
echo "</body>" >> $xyear.html
echo "</html>" >> $xyear.html

for i in `echo 1.html 2.html 3.html 4.html 5.html 6.html 7.html 8.html 9.html 10.html 11.html 12.html`
do
    rm $i
done

rm xx*
rm tmp*