#!/bin/sh
OSE_HOST=
OSE_RELEASE_NAME=
export OSE_RELEASE_NAME
OSE_ROOT=${OSE_ROOT-$WRAPPER_ROOT}
export OSE_ROOT
OSE_VERSION_ROOT=$OSE_ROOT
export OSE_VERSION_ROOT
BINDIR="$OSE_VERSION_ROOT/$OSE_HOST/bin"
LIBDIR=${CLASSINFOLIBDIR-"$OSE_VERSION_ROOT/bin"}
#
# Error.
#
ERROR()
{
echo "`basename $0`: $1" >&2
shift
while test $# != "0"
do
echo $1 >&2
shift
done
exit 1
}
#
# Usage message.
#
USAGE()
{
ERROR "Usage: `basename $0` files"
}
#
# Check usage.
#
if test "$#" = "0"
then
USAGE
fi
while test "$#" != "0"
do
INPUT=$1
BASENAME=`basename $INPUT | sed -e 's/\(.*\)\.[^.]*$/\1/'`
OUTPUT=${BASENAME}.html
if test -f ${INPUT}
then
echo ${BASENAME}
cat ${INPUT} |
sed -e 's/\\-/-/g' \
-e 's/\\ / /g' \
-e 's/\\[0&]/ /g' \
-e 's/&/\&/g' \
-e 's/\</g' \
-e 's/>/\>/g' \
-e 's/\\|//g' \
-e 's/\\e/\\/g' |
/bin/nawk -f ${LIBDIR}/man2html1.awk |
sed -e 's^\\fB\([^\\]*\)\\fR^\1^g' \
-e 's^\\f(CO\(.[^\\]*\)\\fR^\1
^g' \
-e 's^\\fI\(.[^\\]*\)\\fR^\1^g' \
-e 's^\\fB^^g' \
-e 's^\\f(CO^^g' \
-e 's^\\fI^^g' \
-e 's^\\f[RP]^
^g' \
-e 's/^.[LP]P/
/' \
-e 's/^.br/
/' \
-e 's/^\.DS.*/
/' \ -e 's$^\.DE.*$$' \ -e 's/^\.nf */
/' \ -e 's$^\.fi *$$' \ -e 's$^\.BE *$