MANDIR=/usr/man TMPDIR=/usr/man/tmp TOOLS=$MANDIR/tools trap "rm $TMPDIR/tmp.$$ ; exit" 2 3 15 P=108 p="" if test "$1" = "-p" then P=65 p=-p shift fi if test $# -eq 0 then echo "tocrc: no argument" exit fi if test $# -eq 2 then : create toc input file for one section only > $TMPDIR/tocx$1 for file in $MANDIR/man$1/*.$1* do if test ! -s $file then continue fi so=`line < $file | sed "s/ .*//"` if test "$so" = ".so" then continue fi ed - $file > $TMPDIR/tmp.$$ < $TMPDIR/tmp.$$ <> $TMPDIR/tocx$1 fi rm -f $TMPDIR/tmp.$$ done else case $1 in all ) : tocx files for all sections and everything else for x in 1 2 3 4 5 6 7 8 do $0 $p $x $x done $0 $p t ;; t ) : permuted index and toc files if test ! -f $TMPDIR/tocx1 then echo "tocrc: some tocx? files missing" exit fi cat $TMPDIR/tocx? > $TMPDIR/cattoc ed - $TMPDIR/cattoc <