#!/bin/sh # # tex-ortho format header-file body-file # # process body file of message and send # diagnostic to user in from-line # # format can be either of: # # "" = iso format # tex = tex format # tt = tt format # # Adapted on April 17, 1997: T.K. format=$1 header=$2 body=$3 home=${STOLFIHOME}/ortho #lib=$home/PUB/notPUB lib=$home/remote/lib PATH=$home/remote/bin:$home:$PATH export PATH # get the text sender sender=`cat $header | grep "^From: " | cut -d: -f2` from=`echo $sender | tr -s ' ' '\012' | grep @` # body file may contain text part and dictionary part # # a line of the of the form "^++ *dicio" joins them # get the text part, to be checked text=/tmp/ortho.text.$$ # let's have an extra line at the end of body echo "" >> $body sed -n "1,/^++ *dicio/ p" <$body | sed -n "1,/^-- $/ p" | sed " $ d" >$text # get the dictionary part, if present dicio=/tmp/ortho.dicio.$$ touch $dicio if test -n "$format" then sed -n "/^++ *dicio/,/^-- $/ p" <$body | sed "1 d $ d" | $home/${format}iso >$dicio format=${format}- else sed -n "/^++ dicio/,/^-- $/ p" <$body | sed "1 d $ d" >$dicio fi # get the message subject subject=`cat $header | grep "^Subject: " | cut -d: -f2` ############## # spell checks the text # treat options option="-alt" if echo $subject | grep -is "\\-noalt" then option="" fi if echo $subject | grep -is "\\-allwrong" then option="-allwrong" fi diagnostico=/tmp/diagnostico.$$ # include header cp $lib/remote.mess $diagnostico ${format}ortho -remote "$sender" $option $dicio <$text \ >>$diagnostico 2>&1 ############## # send results back to sender # Esta parte não funcionou em Solaris, não sei porque! (tk) # # tk# telnet dcc.unicamp.br smtp >>/dev/null 2>&1 <