4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / share / man / man0 / tocrc
#!/bin/sh -
#
# Copyright (c) 1993
# The Regents of the University of California. All rights reserved.
#
# %sccs.include.redist.sh%
#
# @(#)tocrc 8.1 (Berkeley) %G%
#
tmp=/tmp/toc$$
trap "rm $tmp ; exit" 2 3 15
: tocx files for all sections and everything else
if [ ! -f tocx8 ]; then
for x in 1 2 3 4 5 6 7 8; do
/usr/libexec/getNAME -t `cat man$x` |
sed \
-e 's/.s-2//g' \
-e 's/.s-1//g' \
-e 's/.s0//g' \
-e 's/.s+1//g' \
-e 's/ *.- */: /' \
-e 's/ *$/./' \
-e 's/.TH.* //' \
> tocx$x
done
fi
: permuted index and toc files
cat tocx* cshcmd > /tmp/cattoc
ptx -r -t -b break -f -w 108 -i ignore /tmp/cattoc ptxx
for x in 1 2 3 4 5 6 7 8; do
grep '^intro' <tocx$x >$tmp
sed \
-e '2,${' \
-e '/^intro/d' \
-e '}' \
-e 's/ .*://' \
-e 's/.$//' \
-e 's/([^)]*) /" "/' \
-e 's/.*/.xx "&"/' \
-e '/""/d' \
$tmp tocx$x \
>toc$x
done
exit