code: plan9front

ref: 88a8ca5c8de86f1f3e5b43a490e0e70c6b456072
dir: /sys/lib/man/lookman/mkindex/

View raw version
#!/bin/rc
# creates the index used by lookman
>index
for(i in /sys/man/[0-9]*/[a-z0-9:]*){
	p=`{echo $i | sed 's@/sys/man/\([^ ]\)/\([^ ]*\)$@\2(\1)@'}
	deroff -w_ < $i |
	tr 'A-Z' 'a-z' |
	sort -u |
	comm -23 - junkwords |
	sed 's@$@	'$p'@' >>index		# stick file name on end of line
}
sort -o index index