octacian 84ea1850ce
OctOS: Add ls and cat commands
Allow listing the contents of a directory
and printing the contents of a file.
2018-05-31 11:28:31 -07:00

11 lines
240 B
Lua

local path = ...
path = path[1]
if path then
local contents = fs.list(path)
local result = table.concat(contents.files, " ") .. " " .. table.concat(contents.subdirs, " ")
print(result)
else
print("Must specify path (see help ls)")
end