LC.exec.*

Execution of programs

LC.exec(command)
Arguments
  • input (String) – Command to run (including all parameters)

Returns

exit code, program output and error output

With LC.exec() programs can be executed similar to os.execute(). However, LC.exec() returns the standard output (STDOUT) and error output (STDERR) as well as the exit code of the executed program. This data is also written to the LiveConfig log.

Example

local ex, stdout, stderr = LC.exec("service apache2 restart")

Last updated on Nov 05, 2019.
next: LC.expect.*
previous: LC.crypt.*