#!/bin/sh # argument checking if [ ${#} -ne "2" ]; then echo "Usage: ${0} " exit 1 fi type wvPS 2>&1 >/dev/null if [ ${?} -ne "0" ]; then echo "Could not find required program 'wvPS'" exit 1 fi type distill 2>&1 >/dev/null if [ ${?} -ne "0" ]; then echo "Could not find required program 'distill'" exit 1 fi # intermediate file PS_FILE=${2}.ps wvPS ${1} ${PS_FILE} 2>&1 >/dev/null if [ ${?} -ne "0" ]; then echo "Could not convert into PS" exit 1 fi distill ${PS_FILE} 2>&1 >/dev/null if [ ${?} -ne "0" ]; then echo "Could not convert into PDF" exit 1 fi #clean up rm -f ${PS_FILE} ${PS_FILE}.log mv ${PS_FILE}.pdf ${2} exit ${?}