#!/bin/sh
# handle roff file for html, expects args %f %S
set -e			# die on any error
BASE=`basename $2 .roff`
IN=$2			# input file
OUT=$BASE.eps		# output file, in this case, also temporary
TMP=T$BASE.roff		# temporary file

[ -f "$IN" ] || exit 1	# ensure our file exists
# make sure our temp file does not already exist
if [ -f "$TMP" ]; then
   echo "$0: $TMP is in the way" 1>&2
   exit 1
fi

cat - "$IN" > "$TMP" <<EOF


EOF

 gtbl "$TMP" | groff -Tps >"$OUT" 
/usr/lib/sdc/bin/eps2html "$OUT" "$OUT"
rm -f "$TMP" "$OUT"