#!/bin/sh
# $Header: /u/rywang/cvs/public_html/01f518/changed.cgi,v 1.1 2001/09/29 09:24:31 rywang Exp $
set -f
echo Content-type: text/html
echo
cat <<\END
What's new?
What's new?
END
files=`find . \( -name \*.html -o -name \*.pdf -o -name \*.ps -o -name \*.c -o -name \*.h -o -name \*.ps.gz -o -name \*.txt \) -type f -perm -4 -mtime -3 -print | sed 's/\.\///g'`
if [ -n "$files" ]; then
echo "The pages and files below have changed in the past 3 days:
"
echo ''
for f in `ls -t $files`; do
/usr/ucb/echo -n ''
ls -l $f|nawk ' { printf "%s %s %s | | ", $6, $7, $8 }'
case $f in
*.html) nawk '// { i=match($0, /.*<\/TITLE>/)
if (i>0) { printf "%s", substr($0, i+7, RLENGTH-15); exit }
else printf "'`basename $f`'" }' $f
;;
*) /usr/ucb/echo -n `basename $f`
esac
echo ' |
'
done
if [ -r etc/changedfiles ]; then
nawk %s %s %s | | ", $6, $7, $8
f=$9; if (f ~ /^\/u\//) f=substr(f,4)
printf "%s | \n", f, $9 }'
fi
echo "
"
else
echo "Nothing has changed in the past 3 days
"
fi
#echo "Table of Contents (A list of all the Web pages)
"
echo "
"`date`""
echo ""
exit 0