Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- if #args < 1 then --Controllo se sono stati inseriti tutti i parametri
- print("Uso: cat <file>")
- return
- end
- cdir = "/"
- --Controllo se il file richiesto esiste
- if fs.exists(shell.dir().."/"..args[1]) then
- cdir = shell.dir().."/"..args[1]
- elseif fs.exists(args[1]) then
- cdir = args[1]
- end
- --Leggo e printo il contenuto del file richiesto
- file = fs.open(cdir, "r")
- print(file.readAll())
- file.close()
Add Comment
Please, Sign In to add comment