The <shell> element is a child element of <execNative>. The <shell> element specifies the command to be executed as its content. The command to be executed is interpreted using an interpreter specified using the cmd attribute. The command thus specified is executed using sh –c `command' syntax for the platform. In this form the cmd attribute has to be specified to indicate the shell command to use to execute the command.
For example:
<execNative> <shell cmd=”/usr/bin/bash -c”> ls –l |fgrep `*test*'|sort –u >file.out </shell> </execNative> |
This code executes the command:
/usr/bin/bash –c `ls –l |fgrep `*test*'|sort –u >file.out' |
To preserve formatting and to avoid XML parsing problems, the text contents of the command will always be enclosed within a CDATA element when generating XML representation from the <execNative> step.
It is illegal for command string to be empty or have only white space characters. The command string is supplied exactly as it is specified (with surrounding white space) to the shell.
The contents of the <shell> element are config-generated.
Name |
Type |
Required |
Configurable |
Description |
cmd |
String |
Yes |
Yes |
The shell command in the `sh –c' syntax. The string should not contain any embedded quote characters. The string will be parsed to retrieve the shell name and the arguments using white space a delimiters. For example `/usr/bin/bash –c' should be a non-empty string |