home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / wvwar062.zip / doc / x / helper-scripts / nswordview < prev    next >
Text File  |  2000-09-20  |  548b  |  29 lines

  1. #!/bin/tcsh
  2.  
  3. if ($#argv != 1) then
  4.     echo "Usage: $0 file.doc"
  5.     exit 1
  6. endif
  7.  
  8. set source = $argv[1]
  9.  
  10. #Generate a unique html filename (/tmp/scriptname.pidnum.html)
  11. set com = $0
  12. set temp = /tmp/$com:t.$$
  13. set html = $temp.html
  14.  
  15. (wvWare $source) >! $html
  16. if ((!(-s $html)) | ($status)) then
  17.     echo "$0: failed to generate HTML file"
  18.     exit 1
  19. endif
  20.  
  21. #File exists and is of length > 0, so open it
  22. nsopen $html
  23.  
  24. #I do NOT remove the html file so that the user
  25. #can click on the "Back" button without generating
  26. #a "file not found" error
  27.  
  28. exit 0
  29.