code: 9ferno

ref: 600bbfe4aaa9ad0f73d8d73eef1b7670e5f7d3a3
dir: /man/lib/secindex/

View raw version
#!/bin/rc
U='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
L='abcdefghijklmnopqrstuvwxyz'
builtin cd $1
for (i in [a-z0-9:]*) {
	sed -n '
	/SH *NAM/,/SH/{
		/SH/d
		s/, *$//
		ty
		:y
		s/ *\\*-.*//
		tx
		s/ *\\\(mi.*//
		tx
		s/[,:] */\
/g
		s/\n\\n/\
/g
		y/'$U'/'$L'/
		s/\n/ '$i'&/g
		s/$/ '$i'/
		p
	}
	/SH *DES/q
	d
	:x
	s/ *\\*-.*//
	s/ *\\\(mi.*//
	/^$/d
	s/[,:] */\
/g
	s/\n\n/\
/g
	y/'$U'/'$L'/
	s/\n/ '$i'&/g
	s/(.|\n)*$/& '$i'/
	p
	q
' $i
kw=`{echo $i  | sed 's/0intro/intro/'}
echo $kw $i
} | sort -u