What’s New?
Allows overriding of temporary directory used for running scripts.
Allows overriding of temporary directory used for running scripts.
A shell is a software that provides an interface for users of an operating system that provides access to the services of a kernel. Operating system shells typically fall into 1 of 2 categories: command line and graphical. Command-line shells provide a command-line interface (CLI) to the operating system, while graphical shells provide a graphical user interface (GUI). In either category, the primary purpose of the shell is to call or start another program. Shells frequently have more capabilities such as viewing the contents of directories.
With the Shell plug-in, you can run custom shell scripts during the deployment process.
The Shell plug-in includes steps that run commands on the target system. You can run a command with or without arguments.
This plug-in includes one or more steps, click Steps for step details and properties.
The steps in this plug-in run on any agents that the Deploy server supports.
See Installing plugins in Deploy for installing and removing plugins.
With the Shell plug-in steps, you can run a Shell script as part of the deployment process. The plug-in step contains the scripts.
The steps in this plug-in wait until the command is complete. For best results, run commands that complete or run the commands in the background. If a command runs indefinitely, the step and the process that contains the step wait indefinitely.
The commands for each step share stdout and stdin streams. If you use a command or script that runs other commands, each of those commands uses the same stdout and stdin stream as the first command or script. The step waits for all commands to finish.
Each step runs in its own shell. For example, if you set a system variable in one step, future steps do not have access to the variable because they are running in a new instance of the shell.
If one shell script calls another shell script, starting a child process, this child process inherits the file descriptors of the parent process, such as input and output streams. If the parent shell script exits but the child process does not, the step continues, waiting for output from the child process. To make sure that the step can end normally, redirect the output and error streams for the child process. For example, if the child process is child.sh
, you can redirect the output and error streams with the following code:
child.sh < /dev/null > tempout 2>&1
cat tempout
To access this plug-in in the palette, click Scripting > Shell.
The following process steps are available in the Shell plug-in.
Use this step to run a shell or batch script.
Name | Type | Description | Required |
---|---|---|---|
Daemon | Boolean | If this property is enabled, the command runs in the background while it permits the step to complete immediately. The output is not captured if the command runs as a daemon. | No |
Directory Offset | String | The working directory to use when you execute this command. This directory is relative to the current working directory. | Yes |
Interpreter | String | The interpreter to use to evaluate the command. If this property is left blank the following platform-specific interpreters are used: Windows:.bat file interpreterVMS: .com file interpreterOther: The shell that is specified by the air/shell agent variable if it is present. Linux and UNIX systems might override this setting by having the command line start with a #! sequence. |
No |
Output File | String | Specify this property only if the Daemon property is enabled. The path of the file to which the command output is directed. To discard the output, leave this property blank. The output is captured if an output file is specified. | No |
Shell Script | String | The script code to execute. | Yes |
Use this step to run a shell or batch script a number of times equal to a multi-valued input.
</tr
Name | Type | Description | Required |
---|---|---|---|
Daemon | Boolean | If this property is enabled, the command runs in the background while permitting the step to complete immediately. The output is not captured if it runs as a daemon. | No |
Directory Offset | String | The working directory to use when you execute this command. This directory is relative to the current working directory. | Yes |
Interpreter | String | The interpreter to use to evaluate the command. If this property is left blank the following platform-specific interpreters are used: Windows: .bat file interpreterVMS: .com file interpreterOther: The shell that is specified by the air/shell agent variable if it is present. Linux and UNIX systems might override this setting by having the command line start with a #! sequence. |
No |
Once Per Arg | Boolean | Run the script once for each argument in the xargs property. | No |
Output File | String | The path of the file to which the command output is directed. To discard the output, leave this property blank. The output is captured if an output file is specified. | No |
Shell Script | String | The shell script code to execute. | Yes |
xargs | String | The list input value to the script. Separate each value with the delimiter that is specified in the delimiter property. | Yes |
xargs delimiter | String | The delimiter that is used to separate the input values to the script. The default delimiter used is the comma (,). | Yes |
Uploaded: 31-Aug-2023 21:30
Updated securedata library, so that it will not fail to initialize if AES256 is unsupported.
Uploaded: 31-Aug-2023 21:30
Uploaded: 18-Jul-2023 13:33
Allows overriding of temporary directory used for running scripts.
Uploaded: 30-Jun-2023 06:50
Revert "Fixes APAR PH27500 - Shell step will now use AGENT_HOME/var/temp as the temporary directory." Shell step now uses system temp directory.
Uploaded: 24-May-2023 16:56
Port plug-in to Java
Uploaded: 21-Apr-2023 14:11
Updated Jettison library to 1.5.4 for CVE-2023-1436
Uploaded: 01-Feb-2023 14:30
Updated Jettison library for CVE-2022-45693 and CVE-2022-45685
Uploaded: 03-Jan-2023 15:40
Fixes APAR PH27500 - Shell step will now use AGENT_HOME/var/temp as the temporary directory.
Uploaded: 10-Oct-2022 16:34
Updated Jettison library for CVE-2022-40150 CVE-2022-40149
Uploaded: 08-Apr-2022 15:34
Update log4j 2.17
Uploaded: 07-Feb-2022 16:49
Remove log4j functionality related to: CVE-2019-17571, CVE-2020-9488. CVE-2021-4104, CVE-2022-23302, CVE-2022-23305, CVE-2022-23307
Uploaded: 23-Dec-2021 06:15
Add compatibility with Groovy 3
Uploaded: 02-Dec-2021 06:04
Uploaded: 11-Jun-2021 11:21
Supports property file encryption.
Uploaded: 16-Mar-2021 12:29