#!/bin/sh # argument checking if [ ${#} -ne "2" ]; then echo "Usage: ${0} " exit 1 fi type wvHtml 2>&1 >/dev/null if [ ${?} -ne "0" ]; then echo "Could not find required program 'wvHTML'" exit 1 fi type lynx 2>&1 >/dev/null if [ ${?} -ne "0" ]; then echo "Could not find required program 'lynx'" exit 1 fi # intermediate file TMP_FILE=/tmp/wv${1}.html wvHTML ${1} ${TMP_FILE} 2>&1 >/dev/null if [ ${?} -ne "0" ]; then echo "Could not convert into HTML" exit 1 fi lynx -dump -force_html ${TMP_FILE} > ${2} if [ ${?} -ne "0" ]; then echo "Could not convert into Text" exit 1 fi #clean up rm -f ${TMP_FILE} exit ${?}