-Lua的Hello World
print("Hello World")
分号可选
-类似python,进入Lua后再shell中打命令执行语句也可
> print("Hello, World") Hello, World >
-将脚本存成文件,用如下命令行运行
>lua file.lua
-或者是像shell一样运行
chenhao-air:lua chenhao$ cat hello.lua #!/usr/local/bin/lua print("Hello, World") chenhao-air:lua chenhao$ chmod +x hello.lua chenhao-air:test chenhao$ ./hello.lua Hello, World