code: 9ferno

ref: 6213f356c0ce620aa6611ba81b60cffad3d4d6d2
dir: /man/lib/lookman/mkindex/

View raw version
#!/bin/rc
# creates the index used by lookman
>index
for(i in /usr/inferno/man/[0-9]*/[a-z0-9:]*){
	p=`{echo $i | sed 's@/usr/inferno(/man/.*)$@\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
mv index /usr/inferno/man/index