#!/bin/sh # this does a tax verification #echo Content-type: text/html echo Content-type: text/plain echo HOME=/home/pjbrown cd $HOME/preguide 2>&1 # magic command that directs subsequent errors to stdout RAW_FORM=`cat` #echo "RAW_FORM=$RAW_FORM" #echo TFILE=$HOME/web_tmp/t#tax rm -f $TFILE #echo "hallo" > $TFILE; cat $TFILE; rm -f $TFILE echo "$RAW_FORM" | sed ' s/TAX=// s/+/ /g s/%20/ /g s/%21/!/g s/%22/"/g s/%25/%/g # why is this deletion of & done? s/&/ /g s/%26/\&/g s/%27/'"'"'/g s/%28/(/g s/%29/)/g s/%2B/+/g s/%2b/+/g s/%2C/,/g s/%2c/,/g s/%2F/\//g s/%2f/\//g s/%3B/;/g s/%3b/;/g s/%3A/:/g s/%3a/:/g s/%3F/?/g s/%0D//g s/%0A/\ /g # for some reason %3B seems to become \; BUT the s/\\;/ still does not work, so we delete ANTHING before ";" # PS is the reason: all URL-encoded characters get \ put before them? #s/\\;/;/g s/.;/;/g # ... and similarly for < and > and ~ s/./>/g s/.~/~/g # s/%3D/=/g ' >$TFILE #echo "decoded arg is:"; cat $TFILE EXEC=a.out #echo #echo "EXEC=" #file $EXEC OFILE=$HOME/web_tmp/t_tax_out rm -f $OFILE echo "Output from checker is:" ./$EXEC <$TFILE >$OFILE 2>&1 cat $OFILE GROFF_TMAC_PATH=/home/pjbrown/groff/tmac GROFF_FONT_PATH=/home/pjbrown/groff/font export GROFF_TMAC_PATH export GROFF_FONT_PATH PATH=/home/pjbrown/sunbin:/home/pjbrown/bin:$PATH export PATH $HOME/bin/pweb $OFILE 2<&1