OC-PsychOS/modules/applications/luash.lua

15 lines
416 B
Lua
Raw Normal View History

2017-07-30 19:12:10 +10:00
function luash(si)
spawn("lua shell",function()
2017-07-31 12:10:45 +10:00
function cd(p)
os.setenv("PWD",fs.simplify((os.getenv("PWD") or "")..p))
end
2017-07-31 09:26:58 +10:00
coroutine.yield()
print(_OSVERSION..", "..string.format("%4d",computer.totalMemory()/1024).."K memory, "..string.format("%4d",computer.freeMemory()/1024).."K free")
2017-07-30 19:12:10 +10:00
print(_VERSION)
while true do
2017-07-31 12:10:45 +10:00
write((os.getenv("PWD") or "").."> ")
2017-07-30 19:12:10 +10:00
print(pcall(load(readln())))
end
end,si)
end