Commit 072cd417 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Manual.rst: add more detailed description for '... AS _exec'

parent 3dc8f15b
Pipeline #1738 passed with stage
in 2 minutes and 13 seconds
......@@ -6170,7 +6170,29 @@ Renders images. Allows to define an alternative text and a title attribute for t
Column: _exec
^^^^^^^^^^^^^
Runs batch files or executables on the webserver. In case of an error, returncode and errormessage will be returned.
Run any command on the web server.
* The command is run via web server, so with the uid of the web server.
* The current working directory is the current web instance (e.g. ``/var/www/html``) .
* All text send to 'stdout' will be returned.
* Text send to 'stderr' is not returned at all.
* If 'stderr' should be shown, redirect the output::
SELECT 'touch /root 2>&1' AS _exec
* If 'stdout' / 'stderr' should not be displayed, redirect the output::
SELECT 'touch /tmp >/dev/null' AS _exec
SELECT 'touch /root 2>&1 >/dev/null' AS _exec
* Multiple commands can be concatenated by `;`::
SELECT 'date; date' AS _exec
* If the return code is not 0, the string '[<rc>] ', will be prepended.
* If it is not wished to see the return code, just add ``true`` to fake rc of 0 (only the last rc will be reported)::
SELECT 'touch /root; true' AS _exec
**Syntax**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment