added example (currently with sideeffects)

This commit is contained in:
Leon 2021-11-14 20:47:04 +01:00
parent e5d1536256
commit 1c7e81492d

19
examples/helloshell.lua Normal file
View file

@ -0,0 +1,19 @@
-- o/third_party/lua/lua.com helloshell.lua | sort | uniq
-- output:
-- 124060
-- 130754
-- 2924
-- 2943
-- 2944
function capture(cmd)
local f = io.popen(cmd,'r')
local s = f:read("*a")
f:close()
return s
end
for i=1, 100 do
local stdout = capture('ls -laR / 2>&1')
print(stdout:len())
end