#!/bin/sh # # FILESTATS: Make a File Stats Page that tells you all the goodies # about textfiles.com and lets you see how big the thing is. I="/textfiles/digest/index.html" echo "DIGEST.TEXTFILES.COM" >$I echo "" >>$I echo "
" >>$I echo "
" >>$I echo "
" >>$I echo "" >>$I echo "
 Directory" >>$I echo " # of Files" >>$I echo " Size of Directory" >>$I cd /textfiles/digest for directory in [A-Z]* do if [ -d $directory ] then nfiles="`ls -R /textfiles/digest/$directory | grep -v .html | wc -l`" bytes="`du -sb /textfiles/digest/$directory | cut -f1`" let tfiles=$tfiles+$nfiles let tbyte=$tbyte+$bytes fullname=$directory if [ -f $directory/.fullname ] then fullname="`cat $directory/.fullname`" fi echo "
 $fullname  `/textfiles/magic/comma $nfiles`" >>$I echo "  `/textfiles/magic/comma $bytes`" >>$I fi done echo "
 Totals" >>$I echo " `/textfiles/magic/comma $tfiles` files" >>$I echo " `/textfiles/magic/comma $tbyte` bytes" >>$I echo "
" >>$I echo "" >>$I