home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / oslite11.zip / lthdr.cmd next >
OS/2 REXX Batch file  |  1994-09-20  |  965b  |  47 lines

  1. on break goto clean
  2. if NOT "%@EVAL[2+2]"=="4" goto no4os2
  3. if "%OSLITE"=="" goto err
  4. if "%FULLPAT"=="1" goto leaveasis
  5. SET TMP=%OSLITE\%ORIGNAME
  6. SET %ORIGNAME=%TMP
  7. :leaveasis
  8. set TMP1=%@UNIQUE[%OSLITE]
  9. if NOT EXIST %TMP1 goto tmpfail
  10. if NOT "%@EXT[%0]"=="CMD" goto noext
  11. SET CURNAME=%0
  12. goto doit
  13. :noext
  14. SET CURNAME=%0.CMD
  15. :doit
  16. SET CURPAT=%@SEARCH[%CURNAME]
  17. if NOT "%CURPAT"=="" goto found
  18. SET CURPAT=%CURNAME
  19. echo %CURPAT
  20. :found
  21. skip %LITSIZE <%CURPAT >%TMP1
  22. :decomp0
  23. gzip -dcn <%TMP1 >%ORIGNAME
  24. if NOT ERRORLEVEL==0 goto iscorrupt
  25. %ORIGNAME %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 %12 %13 %14 %15 %16
  26. goto clean
  27. :tmpfail
  28. cho Couldn't create temp file.
  29. goto clean
  30. :err
  31. echo OSLITE environment not defined.
  32. quit
  33. :iscorrupt
  34. echo File is corrupt.
  35. goto clean
  36. :no4os2
  37. echo You must install 4OS2.
  38. quit
  39. :clean
  40. if NOT EXIST %TMP1 goto clean0
  41. del %TMP1 >nul
  42. :clean0
  43. if NOT EXIST %ORIGNAME goto clean1
  44. del %ORIGNAME >nul
  45. :clean1
  46. quit
  47.