DOS allows people to automate simple tasks by creating batch files (filename.bat). These batch files can contain simple commands that can be executed in sequence. Later versions of DOS also added a few extra commands to allow you to conditionally execute statements and to create loops. You can still execute these DOS batch files under OS/2 and they run in a DOS session.
OS/2 also has support for automating tasks in the OS/2 environment using command files (filename.cmd). These files can also implement simple conditional statements the same way that DOS batch files can but OS/2 also provides a much more powerful method which allows you to create much more complicated scripts. You do this by using REXX.
REXX is a scripting language that is not only available on OS/2 but is also available for other operating systems as well. You can write quite complex programs using REXX so you can imagine the power that this gives you when you set up command files using REXX.
Distinguishing between an ordinary command file and a REXX command file is quite simple because REXX always starts with a comment (eg. /* REXX */). When a command file starts with a comment you know that OS/2 will treat the content as a REXX program. Note that the comment can contain whatever you like as long as it starts with /* and ends with */. It can even go over several lines for a longer comment.
OS/2's support for REXX doesn't stop there. OS/2 also provides a graphical environment in which you can create and run your REXX programs. This graphical environment is available via the pmrexx command. Executing pmrexx gives you a window that displays output from your REXX programs, a window to input REXX programs, and browsing scrolling and clipboard functionality within REXX. You also get a testing environment in which to try out your REXX programs.
This article written by Stephen Chapman, Felgall Pty Ltd.