z/OS UNIX System Services User's Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Improving the performance of shell scripts

z/OS UNIX System Services User's Guide
SA23-2279-00

To improve the performance of shell scripts, set the _BPX_SPAWN_SCRIPT environment variable to a value of YES.

If _BPX_SPAWN_SCRIPT=YES is not already placed in /etc/profile, you can put it in your $HOME/.profile.

Here is what the variable does: if the spawn callable service determines that a file is not a z/OS UNIX executable or a REXX exec, this setting causes spawn to run the file as a shell script directly. In the default processing, however, if the spawn callable service determines that a file is not a z/OS UNIX executable or a REXX exec, the spawn fails with ENOEXEC, and the shell then forks another process to run the input shell script. Setting this variable to YES eliminates the additional overhead of the fork.

You may want to set the variable to NO when you are running a non-shell application. For example, if an application does not support shell script invocations, set the variable to NO. Likewise, if an application is in test mode and the returning of ENOEXEC would be a useful indication of an error in the format of the target executable file, set the variable to NO.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014