Execute commands of operative system.

# 1 runtime.exec

<runtime.exec encoding='encoding'>    <string /> !</runtime.exec>

#### Exceptions

A incorrect number of arguments has been specified.

The file or command are in a prohibited access directory.

The command to execute is not found in any of the authorized folders.

#### Remarks

For security, before use <runtime.exec>, you should perform the setting of the Axional Studio server node which will execute this commands. It consist in indicate in the maintenance of the Axional Studio Nodes of the wic_conf in the field Command directories of the section XSQL-Script the path of the directories of which is allowed the execution of commands, for example /bin, /usr/bin, /usr/sbin... (for the execution of command as ls, mkdir ...).

In addition there is also to indicate which are the routes of the accessible files from the Axional Studio server. It consists in indicate in the maintenance of Axional Studio Nodes of the wic_conf in the field File directory of the section XSQL-Script the path of the directories of which is allowed to use the files.

The differences paths separated by the character ',' (comma) and respeting the notation of the platform, the name of the disk drive in uppercase in the case of Windows systems and the separator character '/' (backslash) in the case of Unix/Linux systems.

The standard exit of the executed process is returned as result, being able to be captured in a variable for its previous processing.

To obtain the status of the execution should use the tag <runtime.status>

Example

List the content of the directory /tmp.

Copy
<xsql-script name='runtime_exec_sample1'>
<body>
<set name="m_result">
<runtime.exec>
<string>/bin/ls -l /tmp</string>
</runtime.exec>
</set>
<println><m_result/></println>
</body>
</xsql-script>
Example

Execute the command dd of the operative system to transform a file from the format EBCDIC to ASCII.

Copy
<xsql-script>
<body>
<set name="m_result">
<runtime.exec encoding='utf-8'>
<string>/bin/dd conv=ascii,unblock cbs=128 obs=128 if=/home/jas/temp/536500070514204810_00029418.dat of=/home/jas/temp/536500070514204810_00029418.txt</string>
</runtime.exec>
</set>
</body>
</xsql-script>