darkrc/bin/take
DarkWiiPlayer 6b3f339593 Add take script
Reads N arguments from stdin and prints them
2019-07-24 10:50:34 +02:00

20 lines
298 B
Lua
Executable file

#!/usr/bin/env lua
local num, command = ..., table.concat({select(2, ...)}, ' ')
local input do
if command == '' then
input = io.stdin
else
input = io.popen(command)
end
end
for i=1,num do
local input = input:read '*l'
if input then
print(input)
else
break
end
end