: ########################################################################## # Shellscript: syn - show syntax of a command # Version : 0.2 (beta) # Author : Heiner Steven (heiner.steven@odn.de) # Date : 06.09.94 # SCCS-Id. : $Id: syn,v 1.1.1.1 1999/06/15 19:29:05 heiner Exp $ ########################################################################## # Description # Extracts the SYNOPSIS section of the manual page. # # Changes # 29.06.95 stv Sections must start in column 1 (0.2) ########################################################################## PN=`basename $0` # program name VER='0.2 (beta)' Usage () { echo "$PN - show syntax of a command, $VER (stv '94) usage: $PN command [command ...]" >&2 exit 1 } [ $# -lt 1 -o "$1" = "-h" ] && Usage man "$@" 2>/dev/null | col -b | awk '($1 ~ /^[sS][yY][nN][oO][pP][sS][iI][sS]/) { while ( getline ) { # assume the next section starts with at least two # characters in upper case in column 1 if ( $0 ~ /^[A-Z][A-Z][A-Z]*$/ ) exit 0 # next section print } } '