1#!/bin/rc 2# Usage: sig key ... 3# prints out function signatures by grepping the manual 4 5 6*=`{echo $*|tr A-Z a-z|tr -dc 'a-z0-9_ \012'} # fold case, delete funny chars 7if(~ $#* 0){ 8 echo Usage: sig function ... >/fd/2 9 exit 1 10} 11 12for (i) { 13 files=`{grep -il '[ ]\*?'$i'\(' /sys/man/2/*} 14 for(j in $files) { 15 {echo .nr LL 20i; sed -n '/^.SH SYNOPSIS/,/^.SH.*DESCR/p' $j } | 16 nroff -man | 17 sed ' 18 :a 19 /,$/ { 20 N 21 s/\n// 22 } 23 ta 24 s/[ ]+/ /g' | 25 grep -i -e '[ *]'$i'\(' | sed 's/^[ +]/ /' 26 } 27} 28 29exit 0 30