home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / KERNREV.ZIP / KERNREV.CMD
OS/2 REXX Batch file  |  1992-07-08  |  1KB  |  23 lines

  1. /* REXX */
  2. /* I don't know of any documented way to determine the revision no.         */
  3. /* of a kernel- file under OS/2. But every kernel I've seen so far          */
  4. /* contains a string that identifies the kernel-revision. So I've written   */
  5. /* a small REXX script to do the work - just make sure the relevant kernel  */
  6. /* is in the root of the current drive. If you want to determine the        */
  7. /* revision of another kernel-file, just change the variable "kernel"       */
  8. /* (e.g. "A:\OS2KRNLI" or "C:\OS2KRNL.OLD" etc.):                           */
  9.  
  10. kernel = "\OS2KRNL"
  11. if (stream(kernel, "command", "open read") == "READY:") then do
  12.     string = charin(kernel, , chars(kernel))
  13.     start = pos("Internal revision", string)
  14.     say substr(string, start,  pos(x2c("00"), string, start) - start)
  15.     result = stream(kernel, "command", "close")
  16. end
  17. else
  18.     say "Can't find/open" kernel
  19. exit
  20.  
  21. /* Origin: Thomas Weitzel - Darmstadt Area, Germany (2:2405/4.2)            */
  22.  
  23.