shell

shell.shell.exec

Declaration
lua
shell.exec(cmd [, timeout])
Description
Execute shell command and return output.
Parameters
`cmd` (string) — shell command `timeout` (number, optional) — timeout in seconds
Return Values
`string` — stdout output `number` — exit code
Example
lua
local out, code = shell.exec("ls /var/mobile")
sys.log(out)
Notes
Uses posix_spawn + libroot-resolved /bin/sh.