Listing of showscript.cgi
#!/bin/sh
illegals="\!\@\#\$\%\^\&\*()\|\\\`\~\/\?\,\<\>\:\; "
filename=`echo "${QUERY_STRING}" | sed "s/[${illegals}]//g"` ;
echo Content-type: text/html
echo
echo '<html>'
echo '<head>'
echo '<title>'"Listing of ${QUERY_STRING}"'</title>'
echo '</head>'
echo '<body bgcolor="EEEEEE">'
echo '<h1>'Listing of ${QUERY_STRING}'</h1><hr>'
if (test -r ./${filename}); then
echo '<pre>'
cat ${filename} | /bin/sed -e 's/&/\&/g' -e 's/</\</g' \
-e 's/"/\"/g' -e 's/>/\>/g'
echo '</pre>'
else
echo "I can't find \"${filename}\""
if [ ${filename} != ${QUERY_STRING} ]; then
echo "<br>Illegal characters where present in the QUERY_STRING";
fi
fi
cat address.html
echo '</body>'
echo '</html>'
Mark Frazer -- mjfrazer@gmail.com