To send a command to a specific environment, use this format of the ADDRESS instruction:
ADDRESS environment expression
For environment specify the destination of the command. To address the Windows environment, use the symbol CMD. For expression, specify an expression that results in a string that Rexx passes to the environment. Here are some examples:
address CMD "dir" /* pass the literal string */ /* "dir" to Windows */ address "bash" "ls" /* pass the literal string */ /* "ls" to the Linux bash shell */ cmdstr = "dir *.txt" /* assign a string */ /* to a variable */ address CMD cmdstr /* Rexx passes the string */ /* "dir *.txt" to Windows */ address edit "rain" /* Rexx passes the "rain" */ /* command to a fictitious */ /* environment named edit */
Notice that the ADDRESS instruction lets a single Rexx program issue commands to two or more environments.