#!/bin/rc
echo 'This is just an example of a script that edits the wiki.'
echo 'Do not run this script!'
exit 'no'
path=/bin
rfork n
# plan9.bell-labs is EST
cp /adm/timezone/US_Eastern /env/timezone
page=contrib
test -e /srv/wiki || srv 'net!plan9.bell-labs.com!wiki' wiki || exit
mount -c /srv/wiki /mnt/wiki
lastupdate=`{sed '/^D/q' < /mnt/wiki/$page/current | sed -n 's,^D,,p'}
contrib=/n/sources/contrib/
9fs sources
cd $contrib
#dirs=`{ls| sed 's/(9hist|9hist.tar.gz|alef.tgz|art|old|vga|mothra)//'}
dirs=`{echo $dirs|sed 's/ i//'}
fn author {
tail -1 README |
grep author |
sed 's/@/ at /
s/^author: //'
}
{
echo Contrib
echo D^$lastupdate
echo A^$user
echo contrib.index
for(i in $dirs){
cur = $contrib^$i
cd $cur
echo
echo $cur | tr a-z A-Z
echo
author
echo
sed 's/^/ * /' < INDEX
echo '!'
}
echo -n
} > /mnt/wiki/new
rm /srv/wiki
rm /srv/sources
|