Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

os.execute

Philipp Janda edited this page Mar 11, 2015 · 2 revisions

os.execute

os.execute in Lua 5.2 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 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