Till Lua 5.1, os.execute returns a single result. Starting from Lua 5.2, it returns three results.
Although LuaTeX (v1.21, Feb 2025) uses Lua 5.3, it's os.execute still behaves like that in Lua 5.1. Unfortunately this is not documented in the LuaTeX manual.
See latex3/l3build#333 for more info.
I found a related mailing list thread https://tug.org/pipermail/luatex/2015-November/005536.html .
Update: From the latest reimplementation of os.execute in LuaTeX source (in order to take shell-escape state into account), yes os.execute provided by LuaTeX still returns a single result.
(Updated link to the reimplementation of os.execute in LuaTeX)
Is it possible to overwrite the signature of a Lua builtin function?
Till Lua 5.1,
os.executereturns a single result. Starting from Lua 5.2, it returns three results.Although LuaTeX (v1.21, Feb 2025) uses Lua 5.3, it's
os.executestill behaves like that in Lua 5.1. Unfortunately this is not documented in the LuaTeX manual.See latex3/l3build#333 for more info.
(Updated link to the reimplementation of
os.executein LuaTeX)Is it possible to overwrite the signature of a Lua builtin function?