Execution of programs
LC.
exec
(command)¶
input (String) – Command to run (including all parameters)
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")