Get back the output of os.execute in Lua [duplicate]
Possible Duplicate:
Get back the output of os.execute in Lua
I want to assign the result of a shell command to a lua variable.
Any better way in lua 5.1 than what is answered here? Get back the output of os.execute in Lua
You can use io.popen for this (included in Lua 5.1). That gives you a file handle which you can use to either write or read from (to) the program. More info in the Lua Manual.
精彩评论