4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / share / man / man0 / tocrc
CommitLineData
0e4b7f4e
KM
1#!/bin/sh -
2#
167da3e3
KB
3# Copyright (c) 1993
4# The Regents of the University of California. All rights reserved.
0e4b7f4e 5#
b9f8bd92
KM
6# %sccs.include.redist.sh%
7#
167da3e3 8# @(#)tocrc 8.1 (Berkeley) %G%
0e4b7f4e
KM
9#
10tmp=/tmp/toc$$
0e4b7f4e 11trap "rm $tmp ; exit" 2 3 15
b9f8bd92 12: tocx files for all sections and everything else
0e4b7f4e 13
b9f8bd92
KM
14if [ ! -f tocx8 ]; then
15 for x in 1 2 3 4 5 6 7 8; do
16 /usr/libexec/getNAME -t `cat man$x` |
17 sed \
18 -e 's/.s-2//g' \
19 -e 's/.s-1//g' \
20 -e 's/.s0//g' \
21 -e 's/.s+1//g' \
22 -e 's/ *.- */: /' \
23 -e 's/ *$/./' \
24 -e 's/.TH.* //' \
25 > tocx$x
26 done
27fi
28: permuted index and toc files
0e4b7f4e 29
b9f8bd92 30cat tocx* cshcmd > /tmp/cattoc
0e4b7f4e 31
b9f8bd92 32ptx -r -t -b break -f -w 108 -i ignore /tmp/cattoc ptxx
0e4b7f4e 33
b9f8bd92
KM
34for x in 1 2 3 4 5 6 7 8; do
35 grep '^intro' <tocx$x >$tmp
36 sed \
37 -e '2,${' \
38 -e '/^intro/d' \
39 -e '}' \
40 -e 's/ .*://' \
41 -e 's/.$//' \
42 -e 's/([^)]*) /" "/' \
43 -e 's/.*/.xx "&"/' \
44 -e '/""/d' \
45 $tmp tocx$x \
46 >toc$x
47done
0e4b7f4e 48exit