xref: /original-bsd/share/man/makewhatis.sed (revision 93152bbe)
1#!/bin/sh -
2#
3# Copyright (c) 1988 The Regents of the University of California.
4# All rights reserved.
5#
6# %sccs.include.redist.sh%
7#
8#	@(#)makewhatis.sed	5.5 (Berkeley) 04/17/91
9#
10
11/(\([a-zA-Z0-9]*\).*UNIX Programmer's Manual/ {
12	s;.*(\([a-zA-Z0-9]*\).*UNIX.*;\1;
13	h
14	d
15}
16
17/^NNAAMMEE/!d
18
19:name
20	s;.*;;
21	N
22	s;\n;;
23	# some twits underline the command name
24	s;_;;g
25	/^[^	 ]/b print
26	H
27	b name
28
29:print
30	x
31	s;\n;;g
32	/-/!d
33	s;\([a-z][A-z]\)-[	 ][	 ]*;\1;
34	s;\([a-zA-Z0-9,]\)[	 ][	 ]*;\1 ;g
35	s;[^a-zA-Z0-9]*\([a-zA-Z0-9]*\)[^a-zA-Z0-9]*\(.*\) - \(.*\);\2 (\1) - \3;
36	p
37	q
38