#!/bin/sh # this is a script for processing a form to run one of the cache tests # the data from the form is taken from stdin # NB CURRENTLY THIS SCRIPT CAN ONLY BE RUN ONCE AT A TIME, BECAUSE OF USE OF FIXED TEMPORARY FILES PATH=.:/usr/ucb:/opt/jdk1.2.1/bin:/home/pjbrown/bin:/usr/java/bin:/usr/bin:/usr/local/bin:/bin:/usr/X11R6/bin:/usr/local/jdk/bin:/usr/X11R6/bin:/usr/local/jdk/bin:$PATH export PATH echo "Content-type: text/html" echo # redirect stderr to stdout exec 2>&1 # special set up because HOSTTYPE is not set on apache at exeter if test x"$SERVER_NAME" = x"www.dcs.ex.ac.uk"; then HOSTTYPE=sun4; export HOSTTYPE fi # netscape needs $HOME and $DISPLAY to be set # todo: this needs attention: need to create pseudo-user; also dev/null does not work DISPLAY=/dev/null HOME=/home/pjbrown export HOME export DISPLAY #echo $HOSTTYPE is HOSTTYPE and :$SERVER_NAME: is SERVER_NAME RAW_FORM=`cat` echo "" #echo "$RAW_FROM is RAW_FORM" echo '" # this sets environment variables according to the INPUT tags on the form NEW_FORM=`echo "$RAW_FORM" | sed 's/\&/;/g s/%2F/\//g'` #echo NEW_FORM is $NEW_FORM eval "$NEW_FORM" #echo "
Environment is:";set;echo "
" if test x"$ANN_FILE" = x; then # see if was a GET rather than a POST eval "$QUERY_STRING" if test x"$ANN_FILE" = x; then echo "

error in call of $0: ANN_FILE is set to null" exit 1 fi fi ME=/home/pjbrown DIR=$ME/annotation_experiments/guide_layers/web_experiment USER=pjbrown # owner whose temporary file space is to be used export USER # for wget HTTP_PROXY=http://wwwcache.ex.ac.uk:8080/ http_proxy=http://wwwcache.ex.ac.uk:8080/ export http_proxy export HTTP_PROXY # was, but does not work!: ANN_FILE=$ANN_FILE # to expand * etc # I have not put ANN_FILE in quotes because it may contain * -- however there are problems if it contains spaces -- but these are turned to + so OK ! echo FILE=$ANN_FILE if test -f $ANN_FILE; then BASE=`$DIR/extract_url $ANN_FILE` if test $? = 1; then BASE= fi echo ++++ trying: $DIR/html_save -nr -m "$ANN_FILE" ++++"
" cd $ME/web_tmp # a directory where we can write temporary files GUIDELIB=$ME/guide/guidelib # since Guide is used in the conversion process export GUIDELIB FROM_CGI=yes export FROM_CGI $DIR/html_save -nr -m $ANN_FILE -b "$BASE" # this cats the file exit fi # The error case echo ' Display annotated page: ERROR ' echo "Sorry: $ANN_FILE is not a file that is readable on the file system at Exeter University." echo ""