2017-06-02 12:29:36 +00:00
|
|
|
# lua
|
2020-03-15 14:39:25 +00:00
|
|
|
# Simple, extensible, embeddable programming language
|
|
|
|
|
|
|
|
# You may not have access to the `lua` command, but instead to something like
|
|
|
|
# `lua5.3` or one of a different version. The following information assumes you
|
|
|
|
# have the `lua` command, as-is, but alternative commands may also work the
|
|
|
|
# same or similarly, version allowing.
|
2017-06-02 12:29:36 +00:00
|
|
|
|
|
|
|
# Start an interactive Lua shell:
|
|
|
|
lua
|
|
|
|
|
2020-03-15 14:39:25 +00:00
|
|
|
# Execute a Lua script.
|
|
|
|
lua script_name.lua
|
|
|
|
# Execute a Lua script, with arguments (IE: flags) given to the script itself.
|
|
|
|
lua script_name.lua [ARGS]
|
2017-06-02 12:29:36 +00:00
|
|
|
|
2020-03-15 14:39:25 +00:00
|
|
|
# Execute a Lua expression(s), as though executed from within a script.
|
|
|
|
lua -e 'print("Hello World")'
|
2017-06-02 12:29:36 +00:00
|
|
|
|
2020-03-15 14:39:25 +00:00
|
|
|
# All options are handled in order, except `-i`. For instance, an invocation
|
|
|
|
# like first set a to 1, then print the value of a (1), and finally run the
|
|
|
|
# file `script.lua`
|
2017-06-02 12:29:36 +00:00
|
|
|
lua -e'a=1' -e 'print(a)' script.lua
|
|
|
|
|
|
|
|
# See also:
|
|
|
|
# Lua language cheat sheets at /lua/
|
|
|
|
# list of pages: /lua/:list
|
|
|
|
# learn lua: /lua/:learn
|
|
|
|
# search in pages: /lua/~keyword
|