N1 Grid Service Provisioning System 5.0 XML Schema Reference Guide

<shell> Element

The <shell> element is a child element of <execNative>. The contents of the <shell> element specifies the command to be executed. The command to be executed is interpreted using an interpreter, which is specified by the cmd attribute. The command is executed by using sh -c “command” syntax for the platform. In this form, the cmd attribute must 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>

The previous <execNative> example executes the following 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 is always enclosed within a CDATA element when the XML representation is generated from the <execNative> step.

A command string cannot be empty or contain only white space characters. The command string is supplied exactly as it is specified, including surrounding white space, to the shell.

The contents of the <shell> element are config-generated.

Attributes for the <shell> Element

The <shell> element has one required attribute, cmd, which is the shell command in the sh -c syntax. The string should not contain any embedded quote characters. The string is parsed to retrieve the shell name and the arguments by using white space as delimiters. For example, /usr/bin/bash -c should be a nonempty string. This attribute can reference simple substitution variables.