home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Utilities / wvWare-mos / bin / wvPS < prev    next >
Encoding:
Text File  |  2001-05-14  |  672 b   |  39 lines

  1. #!/bin/sh
  2.  
  3. # argument checking
  4. if [ ${#} -ne "2" ]; then
  5.     echo "Usage: ${0} <word document> <postscript output file>"
  6.     exit 1
  7. fi
  8.  
  9. which wvDVI >/dev/null 2>&1
  10. if [ ${?} -ne "0" ]; then
  11.     echo "Could not find required program 'wvDVI'"
  12.     exit 1
  13. fi
  14.  
  15. which dvips >/dev/null 2>&1
  16. if [ ${?} -ne "0" ]; then
  17.     echo "Could not find required program 'dvips'"
  18.     exit 1
  19. fi
  20.  
  21. # intermediate file
  22. DVI_FILE="${2}.dvi"
  23.  
  24. wvDVI "${1}" "${DVI_FILE}" >/dev/null 2>&1
  25. if [ ${?} -ne "0" ]; then
  26.     echo "Could not convert into DVI"
  27.     exit 1
  28. fi
  29.  
  30.  
  31. dvips -o "${2}" "${DVI_FILE}" >/dev/null 2>&1
  32. if [ ${?} -ne "0" ]; then
  33.     echo "Could not convert into Postscript"
  34.     exit 1
  35. fi
  36.  
  37. #clean up
  38. rm -f "${DVI_FILE}"
  39.