Chapter 14. Issuing System Commands
Overview
One important use of Rexx is to develop command procedures. These are scripts that issue operating system commands. The ability to create command procedures is one of Rexx's great advantages. You can automate repetitive tasks, create scripts for system administration, and customize or tailor the operating system to your preferences.
Command procedures must manage many aspects of interaction with the operating systems, such as building and issuing the proper OS commands and handling bad return codes and errors.
Many refer to command procedures as shell scripts, although technically this is not quite accurate because Rexx is not a shell. Rexx is a scripting language interpreter that runs outside of the shell or OS command interpreter. (There is one exception: a version of Regina runs within the zsh shell and provides true shell scripting capability. With it you can permanently change the current environment and perform tasks that can only be accomplished from within a shell, such as setting environmental variables and changing the working directory).
Command procedures are useful for a wide variety of reasons. Scripting operating system commands allows you to:
Automate repetitive tasks — Ever been faced with entering a lengthy list of commands to get something done? Scripting allows you to automate these tasks, whether they are for system administration or simply for individual users.
An example is an "install script." For one site the author ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access