## Run script for special project - nroff the Atari Lexicon
##

INPUT=/v/doc/doc/mwc
OUTPUT=/tmp/doc/atari

rm -rf $OUTPUT
mkdir $OUTPUT
> special.x

#for i in _ a b c d e f g h i j k l m n o p q r s t u v w x
#do
#	egrep -l TOS $INPUT/lx/MULTI/$i* >TEMPFILE 2>> special.x
#	egrep -l TOS $INPUT/lx/ANSI/$i* >>TEMPFILE 2>> special.x
#	ls $INPUT/lx/AESVDI/$i* >>TEMPFILE 2>> special.x
#	ls $INPUT/lx/TOS/$i* >>TEMPFILE 2>> special.x
#	sort -t/ +7 TEMPFILE >FILES.$i
#done

nroff -x -rX2 -mcohman top.r $INPUT/lx/MULTI/EXAMPLE \
	2>>special.x >$OUTPUT/Example 

for i in _ a b c d e f g h i j k l m n o p q r s t u v w x
do
	for j in `cat FILES.$i`
	do
		nroff -x -rX2 -mcohman top.r \
			$j 2>>special.x >>$OUTPUT/$i.cooked 
		echo "------------------------------" >>$OUTPUT/$i.cooked 
		cat $j >>$OUTPUT/$i.raw
		echo "------------------------------" >>$OUTPUT/$i.raw

	done
done
