3050311118 发表于 2012-7-31 15:27:03

lua可以调用linux的命令么?

lua可以调用linux的命令么?

bbs2009 发表于 2012-7-31 20:07:30

philbar 发表于 2012-8-1 14:42:06

os.execute

3050311118 发表于 2012-8-2 19:48:51

philbar 发表于 2012-8-1 14:42 static/image/common/back.gif
os.execute

嗯 刚也找到了
Lua-- just executing the command
os.execute("ls") -- to execute and capture the output,
use io.popenlocal f = io.popen("ls") -- store the output in a "file"
print( f:read("*a") )    -- print out the "file"'s content
页: [1]
查看完整版本: lua可以调用linux的命令么?