#!/bin/sh header='
Nothing to do.
" exit 1 elif ! type -p zcat &>/dev/null || ! type -p groff &>/dev/null;then echo "$headerEither zcat or groff is not present.
" exit 2 fi base="$(basename "$1")" case "$base" in [1-9]) # section to display secpath="" for p in "/man" "/share/man";do tmppath="$p/man$base" if [ -d "$tmppath" ];then secpath="$tmppath" elif [ -d "/usr$tmppath" ];then secpath="/usr$tmppath" elif [ -d "/usr/local$tmppath" ];then secpath="/usr/local$tmppath" fi done if [ -z "$secpath" ];then echo "$headerManual page section for $base not found." exit 3 fi content="" # FIXME: will break on spaces for page in $(find "$secpath" ! -type d);do tmpbase="$(basename "$page")" content="$content
" done echo "$header $content" ;; *) # actual page to display page="$(man -w "$base" 2>/dev/null)" if [ -z "$page" ];then echo "$headerManual page for $base not found." exit 3 fi zcat "$page" | groff -mandoc -c -Thtml 2>/dev/null ;; esac exit 0;