exec()

Usage

exec(name, parameters...)
exec(name)

Description
Executes the script with the given name. In order to prevent execution of arbitrary code from the Structr rendering context, the script must be registered in the Structr configuration file file using the following syntax.

my.script = scripts/my-script.sh

Upon successful execution, the exec() call returns the output of the script.

Example

${exec('my.script')}

results in

Hello from my-script.sh!

Note
This method does not preserve binary content, it can not be used to stream binary data through Structr. Use exec_binary() for that.

About this article
Last change 2018-05-04
Topics FrontendFunctionsServerStructr 2.0