home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / WordProcessors / PAGESTREAM3,0-1.DMS / in.adf / Macros.LHA / BMEcmdshell.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1994-04-20  |  1.6 KB  |  64 lines

  1. /*
  2.  * cmdshell.rexx
  3.  *
  4.  * This opens up a console window and feeds that typed commands directly
  5.  * to bme.
  6.  *
  7.  * written by Gary Knight 3/24/93
  8.  *
  9.  */
  10.  
  11. options results
  12. options failat 100
  13.  
  14. open('console', 'CON:0/9999/9999/50/BME/SCREEN BME', 'RW')
  15. writeln('console', 'Enter commands, "Q" to exit.')
  16.  
  17. address BME
  18.  
  19. /* loop until user exits */
  20. do forever
  21.  
  22.         /* get command string from user */
  23.         writech('console','CMD> ')
  24.         cmd=readln('console')
  25.  
  26.         select
  27.  
  28.                 /* time to quit? */
  29.                 when (upper(cmd) = "Q") then do
  30.                         leave
  31.                 end
  32.  
  33.                 /* need some help? */
  34.                 when (cmd = "?") then do
  35.                         writeln('console', 'Enter "Q" to exit command shell.')
  36.                 end
  37.  
  38.                 /* do nothing on empty lines */
  39.                 when (cmd = "") then do
  40.                         nop
  41.                 end
  42.  
  43.                 /* whatsinaline */
  44.                 otherwise do
  45.                         /* execute the command string */
  46.                         cmd
  47.  
  48.                         /* if ok show the result, if any */
  49.                         if (RC = 0) then do
  50.                                 if result ~= "RESULT" then writeln('console', result)
  51.                                 if (upper(cmd) = "QUIT") then leave
  52.                         end
  53.  
  54.                         else do
  55.                                 /* ERROR!!!!   get fault string from MCEd */
  56.                                 writeln('console', '*** Error');
  57.                         end
  58.                 end
  59.         end
  60. end
  61.  
  62. exit(0)
  63.  
  64.