Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if #args == 0 then
- printError("Usage: batch <file>")
- return
- end
- local f = args[1]
- local file = fs.open(f, "r")
- local line = file.readLine()
- repeat
- if line ~= nil then
- local words = {}
- for word in line:gmatch("%S+") do
- table.insert(words, word)
- end
- shell.run(unpack(words))
- end
- line = file.readLine()
- until line == nil
- file.close()
Advertisement
Add Comment
Please, Sign In to add comment