#!/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>.*<\/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 '</A></TD></TR>' done if [ -r etc/changedfiles ]; then nawk <etc/changedfiles ' { printf "<TR><TD>%s %s %s</TD><TD></TD><TD>", $6, $7, $8 f=$9; if (f ~ /^\/u\//) f=substr(f,4) printf "<A HREF=\"http://www.princeton.edu/~%s\">%s</A></TD></TR>\n", f, $9 }' fi echo "</TABLE>" else echo "<P>Nothing has changed in the past 3 days</P>" fi #echo "<P><A HREF="toc.cgi">Table of Contents</A> (A list of all the Web pages)</P>" echo "<HR><ADDRESS><SMALL>"`date`"</SMALL><ADDRESS>" echo "</BODY></HTML>" exit 0