blob: 7886874a7d62352456293cc6f6c3fe2fc3cd59e0 [file] [log] [blame] [raw]
local args = table.pack(...)
if args.n == 0 then
print("Usage: cat <filename1> [<filename2> [...]]")
return
end
for i = 1, args.n do
local file, reason = io.open(shell.resolve(args[i]), "r")
if not file then
print(reason)
return
end
repeat
local line = file:read()
if line then
print(line)
end
until not line
end