DarkJMKnight

cat.lua

May 21st, 2023
996
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.22 KB | None | 0 0
  1. args = {...}
  2. if not args[1] then
  3.         print("Usage: cat [file]")
  4.         return
  5. end
  6. local f
  7. for i = 1, #args do
  8.   f = fs.open(args[1], "r") or error("Error while opening file!")
  9.   print(f.readAll())
  10.   f.close()
  11. end
Advertisement
Add Comment
Please, Sign In to add comment