#!/bin/tcsh -f # Produces an inventory of #bbinclude directives in the website set me=$0:t # the name of this program # Abort if the required env variables aren't set if (! ${?HTML_DIR}) then echo ${me}: HTML_DIR environment variable not set\! exit endif set outfile = ~/tmp/${me}.out cd $HTML_DIR pushd tech/bbinclude >&/dev/null set theIncludes=`/bin/ls *.txt` echo "bbincludes included in the the .txt files:" > $outfile foreach x ($theIncludes) set n=`egrep "#bbinclude.*$x" $theIncludes | wc -l` if ($n > 0) then echo " '${x}' found in $n files" >> $outfile endif endif end echo >> $outfile echo "bbincludes included in the website:" >> $outfile popd >&/dev/null foreach x ($theIncludes) set n = `(find . -name \*html -exec egrep "#bbinclude.*$x" {} \; ) | wc -l` echo "$n ${x}" >> $outfile end cat $outfile | mail jtb