Skip navigation links

Package scriptella.driver.shell

Shell scripts driver.

See: Description

Package scriptella.driver.shell Description

Shell scripts driver.

Allows executing OS shell scripts in ETL files.

The query works by executing a shell script and exporting its output as a set of rows, each row representing a line in the output. Script works by sending output of the script to stdout or resource specified by the URL connection parameter.

The driver provides a limited abstraction from the operating system shell environment by the following means:

General information

Driver class:scriptella.driver.shell.Driver
URL:URL of the file to read from and send output to. URIs are resolved relative to a script file. If url is not specified console (System.in/out) is used. Only applies to <script> elements
Runtime dependencies:None.

Driver Specific Properties

Name Description Required
os_behavior Specifies target OS environment and behavior. No, by default the behavior is inferred from os.name/os.version system properties.
shell_cmd Comma-separated list of arguments, representing shell command executable and its parameters, e.g.
/bin/sh,-c.
No, the default list of arguments is OS-specific and is controled by the os_behavior property.

Query and Script Syntax

Query elements are defined in a form of shell commands. The stdout is captured and exported as a set of rows, each row representing a line in the output. Lines are accessible as row variable to inner elements. Script elements also defined as shell commands. The difference from query element is that it's possible to control where the stdout goes by means of url connection parameter.
    <!-- The shell script of the query element produces 2 lines. They are consumed by the inner script element
    which is printing every line of the consumed row prepended with "Exported" prefix. -->
    <query connection-id="in">
        echo Line${1}
        echo Line2
        <script connection-id="out">
            echo Exported $row
        </script>
    </query>
See ParametersCallbackMap class Javadoc for more details.
Skip navigation links

Copyright © Copyright 2006-2019 The Scriptella Project Team.