Skip to content
Philipp Janda edited this page Mar 16, 2015 · 1 revision

os.execute

os.execute in Lua 5.2 and 5.3 returns three values: a boolean indicating sucessful/unsuccessful execution, a string ("exit" or "signal"), and the actual exit status or signal number. To portably distinguish between normal exit and exit by signal, as well as for detecting the signal number or exit status, you need platform specific preprocessor macros (like WEXITSTATUS() in POSIX). Since the compatibility implementation for Lua 5.1 is written in pure Lua and does not have access to those preprocessor macros, the exit status or signal number is probably not correct on all platforms (actually it probably is correct only on Linux).

Clone this wiki locally