xref: /plan9/sys/lib/man/lookman/mkindex (revision 9a747e4fd48b9f4522c70c07e8f882a15030f964)
1#!/bin/rc
2# creates the index used by lookman
3>index
4for(i in /sys/man/[0-9]*/[a-z0-9:]*){
5	p=`{echo $i | sed 's@/sys/man/\([^ ]\)/\([^ ]*\)$@\2(\1)@'}
6	deroff -w_ < $i |
7	tr 'A-Z' 'a-z' |
8	sort -u |
9	comm -23 - junkwords |
10	sed 's@$@	'$p'@' >>index		# stick file name on end of line
11}
12sort -o index index
13