#!/bin/rc # syno - print just the synopsis from the man page rfork e files=() fn search {man -w $*} if (~ $1 -S) { fn search {man -S -w $*} shift } for (i in $*) files=($files `{search $i}) for (f in $files) { echo $f |sed 's!.+/([^/]+)/([^/]+)$!\2\(\1\)!' awk '/.SH SYNOPSIS/,/.SH DESCRIPTION/' $f |\ grep -v '^.SH ' | nroff -man }