# James Zuelow 5-10 Aug 2002
# Thanks to Eric Pement for simplifying script with perl.
#!/bin/sh
# here is where you would test for a valid directory
# Modified by Roy Schestowitz; http://schestowitz.com

find . -type f -regex '.*.htm' > htfile.txt
# note that this does not account for shtml, etc.

for HTFL in `cat htfile.txt`
do
cat $HTFL
perl -ple "s/[^<]+>/\L$&/g" $HTFL > $HTFL.2
# here is where you copy $HTFL.2 over $HTFL
cat $HTFL.2
rm -rf $HTFL
mv $HTFL.2 $HTFL
done

find . -type f -regex '.*.html' > htfile.txt
for HTFL in `cat htfile.txt`
do
cat $HTFL
perl -ple "s/[^<]+>/\L$&/g" $HTFL > $HTFL.2
cat $HTFL.2
rm -rf $HTFL
mv $HTFL.2 $HTFL
done

