5 trap "rm $TMPDIR/tmp.$$ ; exit" 2 3 15
18 echo "tocrc: no argument"
24 : create toc input file for one section only
27 for file in $MANDIR/man$1/*.$1*
33 so=`line < $file | sed "s/ .*//"`
38 ed - $file > $TMPDIR/tmp.$$ <<!
43 loc=`cat $TMPDIR/tmp.$$ | sed "s/.*local.*/local/"`
44 if test "$loc" = "local"
49 name=`echo $name | sed "s/\.\(.\{1,2\}\)\$/(\1)/"`
50 ed - $file > $TMPDIR/tmp.$$ <<!
54 desc=`line < $TMPDIR/tmp.$$`
55 desc=`echo $desc | sed -e "s/.s-1//g" -e "s/.s0//g" -e "s/.s+1//g" -e "s/ .- /: /" -e "s/^/$name /" -e "s/$/./"`
58 echo $desc >> $TMPDIR/tocx$1
64 : tocx files for all sections and everything else
66 for x in 1 2 3 4 5 6 7 8
73 : permuted index and toc files
75 if test ! -f $TMPDIR/tocx1
77 echo "tocrc: some tocx? files missing"
80 cat $TMPDIR/tocx? > $TMPDIR/cattoc
81 ed - $TMPDIR/cattoc <<!
94 ptx -r -t -b $TOOLS/break -f -w $P -i $TOOLS/ignore $TMPDIR/cattoc $MANDIR/man0/ptxx
95 for x in 1 2 3 4 5 6 7 8
97 ed - $TMPDIR/tocx$x << !
102 1,\$s/([1-8][a-z]\{0,1\}) /" "/