shithub: riscv

ref: ff2ebe6cfdacd890a74a6d2f9b0acd062d2633b7
dir: /sys/lib/man/secindex/

View raw version
#!/bin/rc
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
		s/$/ '$i'/g
		p
	}
	/SH *DES/q
	d
	:x
	s/(^| * )\\*-.*//
	s/ *\\\(mi.*//
	/^$/d
	s/, */\
/g
	s/\n\n/\
/g
	s/$/ '$i'/g
	p
	q
' $i
echo $i $i
} |sort -u