#!/bin/sh spoof=dick home=/home/u/faculty/dick/ bin=$home/bin export spoof home bin echo Content-type: text/html echo echo "define2 $QUERY_STRING" echo if [ x"$REQUEST_METHOD" = xPOST ] then QUERY_STRING=`/u/faculty/dick/bin/unpost $CONTENT_LENGTH` fi echo QUERY_STRING="$QUERY_STRING" "REMOTE_ADDR=$REMOTE_ADDR" HTTP_REFERER="$HTTP_REFERER", define2|mail -s define2 $spoof@csci.csusb.edu if [ x"$QUERY_STRING" = x ] then echo Please add a question mark and a word to your query else if expr "$QUERY_STRING" : ".*search=" >/dev/null then SEARCH=`expr "$QUERY_STRING" : ".*search=\([^&]*\)"|$bin/urlunencode` export SEARCH echo "

Searching for $SEARCH

" if expr "$QUERY_STRING" : ".*case=on" >/dev/null then OPTION="-e" else OPTION="-ie" fi echo 'Terms defined in my home dictionary


' echo 'Terms defined in my documentation


' echo 'Terms defined in Samples Dictionary


' if expr "$QUERY_STRING" : ".*examples=on" >/dev/null then echo "

Possible examples of C and C++ code

" echo "" echo '
' fi if expr "$QUERY_STRING" : ".*bibliography=on" >/dev/null then BIBSEARCH=`echo "$SEARCH"|sed '/^\./!y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` echo "

Items in bibliography containing a string matching \"$BIBSEARCH\"

" sed '/^\./!y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' < /home/u/faculty/dick/newbib.mth | awk 'BEGIN{n=0} /^\. /{item_name=$0; printed=0;} /'"$BIBSEARCH"'/{if(!printed){n++;print substr(item_name,3); printed=1;}} END{print "

Number found="n;}'| sed '/^

Number found/!s/.*/&<\/A>, . . . /' echo '


' fi QUERY_STRING="glossary=on&""$QUERY_STRING" for where in glossary syntax lexicon semantics methods do if expr "$QUERY_STRING" : ".*$where=on" >/dev/null then #echo Searching for $SEARCH in samples/"*".$where"*" egrep $OPTION "$SEARCH.*::" $home/samples/*$where.mth| /u/faculty/dick/bin/ascii2html | sed 's/.home/u/faculty/dick.samples.\(.*\).mth:/

\1<\/A>. /' fi done for where in math logic notn type intro do if expr "$QUERY_STRING" : ".*$where=on" >/dev/null then #echo Searching for $SEARCH in maths/"*"$where"*" egrep $OPTION "$SEARCH.*::" $home/maths/*$where*mth| /u/faculty/dick/bin/ascii2html | sed 's/.home/u/faculty/dick.maths.\(.*\)mth:/

\1<\/A>. /' fi done if expr "$QUERY_STRING" : ".*UNIX=on" >/dev/null then where=cs360 echo "


Searching for $SEARCH in UNIX ($where/dictionary.html)
" if [ -r $home/$where/dictionary.html ] then egrep $OPTION "$SEARCH" $home/$where/dictionary.html else echo "
Unable to find $home/$where/dictionary.html.
" fi fi for where in se java do if expr "$QUERY_STRING" : ".*$where=on" >/dev/null then echo "
" #echo Searching for $SEARCH in $where.*.html egrep $OPTION "$SEARCH" $home/$where.www.sites.html | sed 's/
  • /
    /g' fi done if expr "$QUERY_STRING" : ".*teaching=on" >/dev/null then echo "
    " echo '

    Terms used my teaching:


    ' fi echo "
    " echo "

    Also see my Software Development Page" echo "


    " echo '

    Comment Form

    ' echo '
    ' echo 'Please delete the comment that does not apply and add' echo 'any other comment you would like:' echo '
    ' echo '' echo '
    ' echo 'Select to send your comment.' echo '
    ' echo '
    ' echo "
    " else echo "No search specified in \"$QUERY_STRING\"" echo "" exit 1 fi fi echo ""