33 lines
435 B
Lua
Executable file
33 lines
435 B
Lua
Executable file
#!/usr/bin/env lua
|
|
|
|
local m = {}
|
|
|
|
print("Hello")
|
|
os.execute("echo $SHELL")
|
|
|
|
m.abc = {
|
|
kek = 10,
|
|
}
|
|
|
|
function m:print()
|
|
print(m.abc.kek)
|
|
end
|
|
|
|
function os.getName()
|
|
local osname
|
|
-- ask LuaJIT first
|
|
if jit then
|
|
return jit.os
|
|
end
|
|
|
|
-- Unix, Linux variants
|
|
local fh, _ = assert(io.popen("uname -o 2>/dev/null", "r"))
|
|
if fh then
|
|
osname = fh:read()
|
|
end
|
|
|
|
return osname or "Windows"
|
|
end
|
|
|
|
m:print()
|
|
print(os.getName())
|