run_command

This commit is contained in:
Yago 2014-12-17 13:01:34 +01:00
parent 258c5bfff4
commit 8775f720a6
1 changed files with 9 additions and 1 deletions

View File

@ -110,4 +110,12 @@ function scandir(directory)
t[i] = filename
end
return t
end
end
-- http://www.lua.org/manual/5.2/manual.html#pdf-io.popen
function run_command(str)
local cmd = io.popen(str)
local result = cmd:read('*all')
cmd:close()
return result
end