mkindexs.sh

 

###
### File: mkindex.sh
###
### For all files in current directory 
### create an index.html linking to said files.
###
###

PWD=`pwd`
title=`basename $PWD`

ls -1 * | grep -v index.html > tmp.out

cp tmp.out tmp1.out
paste tmp.out tmp1.out > tmp2.out

echo "<html>" > index.html
echo "<head>" >> index.html
echo "<META content=text/css http-equiv=Content-Style-Type>" >> index.html
echo "<LINK href=\"http://www.setgetweb.com/lstyle.css\" rel=\"stylesheet\" type=\"text/css\">" >> index.html
echo "   <title> $title </title>" >> index.html
echo "</head>" >> index.html
echo "<body>" >> index.html
echo "   <center>" >> index.html
echo "   <table width=\"80%\">" >> index.html
echo "   <TR>" >> index.html
echo "   <td>" >> index.html
echo "   " >> index.html
echo "<p> </p>" >> index.html
echo "<center>" >> index.html
echo "<h1> $title </h1>" >> index.html
echo "</center>" >> index.html
echo "<p><hr noshade>" >> index.html
echo "<p><ol>" >> index.html

sed "s/^/<li><a href=\"/g" tmp2.out | \
sed "s/	/\">/g" | \
sed "s/$/<\/a>/g" >> index.html 

echo "</ol>" >> index.html
echo "<p><hr noshade>" >> index.html
echo "<p>&nbsp;</p>" >> index.html
echo "<p>&nbsp;</p>" >> index.html
echo "<p>&nbsp;</p>" >> index.html
echo "<br> Copyright 2002. All Rights Reserved. " >> index.html
echo "<script javascript=\"JavaScript\"> " >> index.html
echo "    document.write(\"<br>Last updated: \"+document.lastModified); " >> index.html
echo "</script> " >> index.html
echo "<p><hr noshade>" >> index.html
echo "" >> index.html
echo "   </td>" >> index.html
echo "   </tr>" >> index.html
echo "   </table>" >> index.html
echo "   </center>" >> index.html
echo "   </body>" >> index.html
echo "</html>" >> index.html