#!/bin/rc path = (/bin .) # speed hack rfork n # Avoid conflicts with other connections in /srv. prog=`{basename $0} rm /srv/wiki.$prog >[2] /dev/null srv 'net!plan9.bell-labs.com!wiki' wiki.$prog >[2] /dev/null || exit mount -c /srv/wiki.$prog /mnt/wiki # plan9.bell-labs is EST cp /adm/timezone/US_Eastern /env/timezone page='what''s_new' lastupdate=`{sed '/^D/q' < /mnt/wiki/$page/current | sed -n 's,^D,,p'} { awk -v 'lastupdate='^$lastupdate ' BEGIN { print "What''s New" print "D" lastupdate print "Aanothy" print "Cnew wiki update script" print "\nRecently changed wiki pages:\n" sort="/bin/sort -r -n +0 | /bin/sed 's/^[0-9]*//'" } FNR == 1 { title = $0; }; FNR != 1 && $0 ~ "^D" { datesec = substr($0,2) dcmd = "date "datesec dcmd | getline date close(dcmd) }; FNR != 1 && $0 ~ "^A" { author = "["substr($1,2)"] "$2; } FNR > 3 { print datesec" * "date" ["title"] -- By "author | sort nextfile title = "" date = "" datesec = "" author = "" } END { close(sort) print "\n"} ' `{ echo /mnt/wiki/*/current |sed 's%/mnt/wiki/(contrib_index|what''s_new)/current%%'g } echo -n } > /mnt/wiki/new