lua (一) : mac终端下使用 brew安装lua
2015-06-18 22:09
543 查看
*mac下的安装
brew工具套装网址:brew.sh
1.安装brew:终端下执行一下命令
brew工具套装网址:brew.sh
1.安装brew:终端下执行一下命令
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"[/code]
2.执行命令 :brew install lua安装lua
3.成功后,执行命令 :lua进入lua脚本环境
4.经典开始> print("hello world") hello world> var = "hello" > print(var) hello> print ("x" .. "y") xy
5.执行lua脚本
创建文本文件hello.lua
内容为:print("hello lua!") name = io.read() print("hello " .. name)
终端下执行文件目录下执行$ lua helloLus.lua hello lua! lee hello lee
如果无法执行,对文本添加执行权限,执行:$ chmod +x hello.lua //查看文件权限 $ ls -l -rwxr-xr-x 1 binlinghu staff 20 6 18 21:36 hello.lua
然后再执行:$ lua helloLus.lua hello lua! lee hello lee
相关文章推荐
- 自学Lua(2)--Lua表达式
- 自学Lua(1)--Lua语法特点
- 4.Lua面向对象概念
- 3.Lua表和数组
- lua 获取指定目录下指定后缀文件名
- 我所理解lua 语言中的点、冒号与self
- 1.Lua 环境搭建
- lua文件读写
- Lua lib 加载分析
- Virtual View Synthesis Method and Self Evaluation Metrics for Free Viewpoint Television and 3D Video
- Lua 学习笔记四 CoronaSDK使用
- Lua之sethook学习
- Lua之pcall和xpcall之学习
- Lua如何设置局部变量值进行调试
- VC中出现error C2064: term does not evaluate to a function
- Lua5.3 注册表 _G _ENV
- lua元表
- Lua5.3 注册表 _G _ENV
- 该怎样理解 Lua 逻辑运算符 and 和 or 的设计?
- Lua for Windows 安装方法