Advertisement
Guest User

Untitled

a guest
Nov 4th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.23 KB | None | 0 0
  1. function io.popen_read_all(command)
  2.     local handle = io.popen(command)
  3.     local result = handle:read("*all")
  4.     handle:close()
  5.  
  6.     return result
  7. end
  8.  
  9. -- example
  10. output = io.popen_read_all("ls -a")
  11. output = io.popen_read_all("date")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement