Create a template from a script

To include a script in an application configuration object you must copy the script into a CML template then import the template into the application configuration object. For details on CML, see CML Reference. See Run scripts with Application Configurations.

The following example shows a simple Unix shell script that performs a touch command and an echo command:

#/bin/sh
touch abc.txt
echo abc >>abc.txt
The following example shows this Unix shell script converted to CML:
@#########################################################
# /tmp/simple-script/TouchABC.sh                         #
# Version 0.1                                            #
# Author: <name>                                         #
#########################################################@
@!namespace=/simple-script-namespace/@
@!filename-key="/TouchABC"@
@!filename-default=/tmp/simple-script/TouchABC.sh@
#/bin/sh
touch abc.txt
echo abc >>abc.txt

To create a template from this script:

  1. Create a template as described in test text . Use the CML version of your script as the contents of the template.
  2. Set the Type field to the appropriate script type. For the above example, you would set the Type to “Unix .SH script”. Other supported script types are listed in Types of Application Configuration scripts.
  3. Set the Parser Syntax field to “CML Syntax” since all scripts must be written in CML syntax.
  4. Set the remaining fields as described in test text .
  5. Select File > Save.
  6. Select File > Close.
  7. Add your template to an application configuration object as described in Add or remove templates from an Application Configuration.
  8. After adding your template to an application configuration object, open the application configuration object.
  9. Select the Configuration Values view.
  10. Select the script template and right-click to display the menu.
  11. Select the script type, which specifies when the script will run: Data-manipulation, Pre-install, Post-install or Post-error.
  12. Select File > Save.
  13. Select File > Close.