Hi All,
The idea is simple. 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 element works by sending output of the script to stdout or resource specified by the URL connection parameter. Example:
<!-- 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>
It also provides limited abstraction from the operating system shell environment by means of <dialect> element:
<script connection-id="in">
<dialect name=".*win.*">
Echo Running Windows
</dialect>
<dialect name=".*linux.*">
echo Running Linux/Unix
</dialect>
<dialect name=".*mac.*">
echo Running Mac OS
</dialect>
</script>
It is inspired by the driver suggested in the early days of Scriptella, but the actual implementation got lost due to javaforge shutdown.
One of the immediate use-cases - it will serve as a replacement for the mail driver, which is going to be removed in 1.3 due to compatibility problems with JDK11.
But there are many more usages for shell scripts.
Connection declaration:
<connection id="out" driver="shell" />