Following Alcides‘ post Unix in Scala I spent a few minutes doing the same with 9 lines of code using Lua and no $voodoo involved.
print ("You have mail")
while true do
io.stdout:write ("$")
c1 = io.stdin:read()
if c1 == "uname"
then print ("Lunix 0.1 (Lua)")
else print ("Command " .. c1 .." not found.")
end
end
Needless to say that his is in no way serious, it’s just silliness like Songs in Code (which I failed to participate in, but eh… the night is young) and i’m sure that reducing unix to three lines of interaction is going to offend a few people.
Lua came into play when I felt the need to change a few nmap scripts to suit my needs. It’s been really fun working with it even though it’s a bit hard to find good documentation about it on the web. Which reminds me… my amazon wishlist has one or two books on Lua. Hey, just saying…
0 ResponsesLeave a comment ?