#!/bin/ksh ## ## ======================================================= ## used to create the output files for all ManPages ## ======================================================= ## set -o allexport # START exporting all VARs BASEDIR="./manuals" MAN=/bin/man ## MAN2HTML=/usr/local/bin/man2html MAN2HTML=`whence man2html` USAGE="$0 [Section] cmd1 [Section] cmd2 [Section] ... cmdN " set +o allexport # STOP exporting all VARs if [[ ! -z $1 ]] ## Make sure at least one cmd was provided then ## for i in "fork pipe read write strtoul malloc" SECTION="" # Get the rest of the commands to lookup for i in $* do if [[ "$i" = "[0-9]*" ]] # Check for Section Number then SECTION=$i shift # Move pointer to next SEction or CMD fi export SECTION ### $$ will assign an unique value from ProcID to each output if [[ ${i} != "$0" ]]; then ### ## else echo "$MAN $SECTION ${i}..." $MAN $SECTION ${i} | $MAN2HTML >> $BASEDIR/${i}.html fi done else echo $USAGE fi