: remove old
rm man[1-8].toc man[1-8].buf
: create ptx files
>ptx.in
>ptx.out
: cycle through man dirs
for MAN in ../man[1-8]
	do 
	for PG in $MAN/*.[1-8]*
		do
		: echo name.extension
		echo `basename $PG` | sed 's/\(.*\)\.\(.*\)/\1(\2)/'\
		>>`basename $MAN`.buf
		: 
		sed -n -f ptx.script $PG \
		| tee -a `basename $MAN.`toc >>`basename $MAN`.buf
		done
	cat `basename $MAN`.buf >>ptx.in
	done 
: pair up lines for table of contents
for TOC in man[1-8].buf ptx.in
	do
	sed -f pairs $TOC >s$$
	mv s$$ $TOC; rm s$$
	done
: the following works for NROFF only
ptx -r -f -w 46 -i ignore ptx.in >ptx.out
: create final index, place it at back of manual
mm index.s >index.mm
for i in man*.toc
	do sed -f sedtoc $i >`basename $i .toc`toc.s
	done
: man?toc.s directories need to be altered by hand
: then run mm toc.s to create final TOC
