#! /bin/sh

echo Content-type: text/html
echo

echo "<html><head><title>List of attribute files</title></head>"
echo "<body><h1>List of attribute files</h1>"

TEMPNAME=../edit-requests/t$$
output=html
echo "<ul>"
echo $QUERY_STRING | tr '&+' "\012 " | sed -e "s/=/=\"/" | sed -e s/$/\"/ | egrep "^type=\"[^\"]*\"$" > $TEMPNAME
. $TEMPNAME
ls -1 ../${type}s/*.attr ../${type}s/new/*.attr | sed "s:^\\.\\./${type}s/\\(.*\\)\\.attr$:<li> <a href=\"getplan.cgi\?type=${type}\&output=${output}\&name=\\1\">\\1</a>:" | sed "s:new/::g" | sort
echo "</ul>"

rm $TEMPNAME

echo "</body></html>"
echo
