Annotation of researchv10dc/cmd/wwb/wwb.sh, revision 1.1.1.1

1.1       root        1: # NOTICE-NOT TO BE DISCLOSED OUTSIDE BELL SYS EXCEPT UNDER WRITTEN AGRMT
                      2: L=/usr/lib/style
                      3: trap 'rm -f /tmp/$$*; trap 0; exit' 0 1 2 3 15
                      4: if test $# = 0
                      5: then echo "Usage: wwb [-mm|-ms] [-li|+li] [-s] [-c|-t|-tm] [-x standards-file] file ..."
                      6:        exit 1
                      7: fi
                      8: mflag=-ms
                      9: mlflag=-ml
                     10: sflag=
                     11: fflag=
                     12: file=
                     13: xfile=
                     14: audflag=m
                     15: while test '$1'
                     16:        do case $1 in
                     17:                -ver) echo $0 version 2.5:: 2.1,2.0; exit 0;;
                     18:                -flags) echo "$0 [-flags] [-ver] [-mm|-ms] [-li|+li] [-tm|-t|-c|-x standards-file] [-s]  [file ...]";exit 0;;
                     19:                -mm) mflag=-mm;shift;continue;;
                     20:                -ms) mflag=-ms; shift;continue;;
                     21:                -li|-ml) mlflag=-ml;shift;continue;;
                     22:                +li) mlflag=;shift;continue;;
                     23:                -f) fflag=F; shift; file=$1;shift;continue;;
                     24:                -c) audflag=c;shift;continue;;
                     25:                -t) audflag=t;shift;continue;;
                     26:                -tm) audflag=m;shift;continue;;
                     27:                -x) audflag=x;shift; xfile=$1; shift;continue;;
                     28:                -s) sflag=s;shift;continue;;
                     29:                -*) echo unknown wwb flag $1; exit;;
                     30:                *) break;;
                     31:        esac
                     32: done
                     33: if test $fflag
                     34: then   if test ! -r $file
                     35:        then echo Can\'t find the file $file, try specifying a more complete pathname.
                     36:        exit 1
                     37:        fi
                     38: fi
                     39: if test $audflag = x
                     40: then   if test ! -r $xfile
                     41:        then echo Can\'t find the standards file $xfile, try specifying a more complete pathname.
                     42:        exit 1
                     43:        fi
                     44: fi
                     45: if test $# = 0
                     46: then   echo "Usage: wwb [-mm|-ms] [-li|+li] [-s] [-c|-t|-tm] [-x standards-file] file ..."
                     47:        exit 1
                     48: fi
                     49: for i in $*
                     50: do
                     51:        if test ! -r $i
                     52:        then echo Can\'t find the file $i\; try specifying a more complete pathname.
                     53:        exit 1
                     54:        fi
                     55:        if test $sflag
                     56:        then
                     57:         echo -e "\n"--SPELLWWB for $i--
                     58:                if test -r $HOME/lib/spelldict
                     59:                then spell $i|sort|comm -23 - $HOME/lib/spelldict |pr -r -3 -t -i" "25
                     60:                else spell $i |pr -r -3 -t -i" "25
                     61:                fi
                     62:         echo -e "\n"--PUNCT for $i--
                     63:        sed "s/^'/./" $i >/tmp/$$in
                     64:                $L/punlx < /tmp/$$in| bdiff /tmp/$$in - |sed -f $L/seddiff 
                     65:         echo -e "\n"--DOUBLE for $i--
                     66:                double $i
                     67:         echo -e "\n"--DICTION for $i--
                     68:                if test -r $HOME/lib/ddict
                     69:                then    $L/dprog -l -f $HOME/lib/ddict $i 
                     70:                else    $L/dprog -l $i 
                     71:                fi
                     72:         echo -e "\n"--GRAM for $i--
                     73:                deroff -n $mflag $mlflag  $i|$L/style1  |$L/style2 | tee /tmp/$$style2 | $L/style3 -P -L| $L/gramlx 
                     74:                echo -e __"\n"
                     75: else
                     76: { 
                     77: echo -e "******************************  SPELLING  *******************************\n"
                     78: if test -r $HOME/lib/spelldict
                     79: then spell $i|sort|comm -23 - $HOME/lib/spelldict >/tmp/$$spell
                     80: else spell $i>/tmp/$$spell
                     81: fi
                     82: if test -s /tmp/$$spell
                     83: then echo -e Possible spelling errors in $i are:"\n"
                     84:        pr -3 -t -i" "25 /tmp/$$spell
                     85:        echo -e '\nIf any of these words are spelled correctly, later type
                     86:                   spelladd word1 word2 ... wordn
                     87: to have them added to your spelldict file.'
                     88: else   echo No spelling errors found in $i
                     89: fi
                     90: echo -e "\n\n*****************************  PUNCTUATION  *****************************\n"
                     91: echo -e "For file $i:\n"
                     92: sed "s/^'/./" $i >/tmp/$$in
                     93:        echo -e '\nThe program next prints any sentence that it thinks is 
                     94: incorrectly punctuated and follows it by its correction.\n'
                     95: $L/punlx </tmp/$$in >/tmp/$$punct
                     96: echo -e "\n"
                     97: bdiff  /tmp/$$in /tmp/$$punct >/tmp/$$diff
                     98: if test ! -s /tmp/$$diff
                     99: then echo -e  No errors found in $i"\n"
                    100: else   sed -f $L/seddiff /tmp/$$diff
                    101:        echo -e "\n\n"
                    102:        echo -e For more information about punctuation rules, type:"\n                            " punctrules
                    103: fi
                    104: echo -e "\n\n*****************************  DOUBLE WORDS  ****************************"
                    105: echo -e "\nFor file $i:\n"
                    106: double $i
                    107: echo -e "\n\n*****************************  WORD CHOICE  *****************************\n"
                    108: echo -e 'Sentences with possibly wordy or misused phrases are listed next, 
                    109: followed by suggested revisions.\n'
                    110: if test -r $HOME/lib/ddict
                    111: then echo -e NOTE: proofr is using your file $HOME/lib/ddict for additional phrases."\n"
                    112: fi
                    113: echo -e "\nFor file $i\n"
                    114: if test -r $HOME/lib/ddict
                    115: then   $L/dprog -l -f $HOME/lib/ddict -o /tmp/$$dictsed $i
                    116: else $L/dprog -l -o /tmp/$$dictsed $i
                    117: fi
                    118: if test -s /tmp/$$dictsed 
                    119: then
                    120:        echo -e '\nPlease wait for the substitution phrases\n
                    121: \n-------------------   Table of Substitutions   --------------------\n
                    122: PHRASE                     SUBSTITUTION\n'
                    123:         sort -u /tmp/$$dictsed |sed -f $L/script.sed | split -50 -f /tmp/$$d_
                    124:        for j in /tmp/$$d_*
                    125:        do
                    126:                sed -n -f $j $L/suggest.d >>/tmp/$$d
                    127:        done
                    128:        sort /tmp/$$d
                    129:        echo -e '\n------------------------------------------------------------------\n
                    130: \n    * Not all the revisions will be appropriate for your document. 
                    131:     * When there is more than one suggestion for just one bracketed
                    132:       word, you will have to choose the case that fits your use.
                    133:     * Capitalized words are instructions, not suggestions.\n
                    134: NOTE: If you want this program to look for additional phrases
                    135:       or to stop looking for some, for instance to stop 
                    136:       flagging "impact," type the command dictadd.'
                    137: fi
                    138: echo -e "\n\n***************************  GRAMMATICAL ERRORS  ************************"
                    139: echo -e "\nFor file $i:\n"
                    140: deroff -n $mflag $mlflag  $i|$L/style1  |$L/style2 | tee /tmp/$$style2 | $L/style3 -P -L| $L/gramlx >/tmp/$$split
                    141: if test -s /tmp/$$split
                    142: then cat /tmp/$$split
                    143:        echo -e '\nFor information on split infinitives type:
                    144:                                   splitrules'
                    145: else echo  No split infinitives found 
                    146: fi; }|pr -h "PROOFR OUTPUT FOR $i"
                    147: fi
                    148:                if test $fflag
                    149:                then    if test $sflag
                    150:                        then $L/prose f${sflag}${audflag} $xfile  < $file
                    151:                        else $L/prose f${audflag} $xfile < $file |pr -e0 -h "PROSE OUTPUT FOR $file"
                    152:                        fi
                    153:                else
                    154:                        if test $sflag
                    155:                        then  $L/style3 < /tmp/$$style2 | tee styl.tmp| $L/prose ${sflag}${audflag} $xfile  $$
                    156:                        else $L/style3 < /tmp/$$style2 | tee styl.tmp| $L/prose ${audflag} $xfile $$ |pr -h "PROSE OUTPUT FOR $i"
                    157:                        fi
                    158:                fi
                    159: done

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.