addcopyright.sh

 

#
### addcopyright.sh 
###
### For all HTML files in current directory
### add copyright information to the bottom
### of the file.
###

for i in `ls *.html`
do

   
   if grep -s Copyright $i >/dev/null
   then 
       echo "Skipping $i "     
   else 
       echo "Modifying $i"     

       csplit -s $i /"<\/body"/
   
       x=`ls -l $i | cut -c46-58`

       echo "  " 						>> xx00
       echo "<p><hr>  " 					>> xx00
       echo "<center>" 						>> xx00
       echo "<br> Copyright 2002. All Rights Reserved. " 	>> xx00
       echo "<script javascript=\"JavaScript\"> " 		>> xx00
       echo "    document.write(\"<br>Last updated: \"+document.lastModified); " >> xx00
       echo "</script> " 					>> xx00
       echo "  " 						>> xx00

       echo "<p><hr>" 						>> xx00
       echo "  " 						>> xx00

       cat xx00 xx01 > $i

   fi
   rm xx00 xx01 2>/dev/null

done