You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

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.

Search results for "exec()"

exec()

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 structr.conf file using the following syntax.
key.for.my.script = my-script.sh
Upon successful execution, the exec() call returns the output of the script.

exec(key [, parameters... ] )