LinuxCommandLibrary

lua

programming language interpreter

TLDR

Start interactive interpreter

$ lua
copy
Run script
$ lua [script.lua]
copy
Execute code
$ lua -e "[print('Hello')]"
copy
Run with arguments
$ lua [script.lua] [arg1] [arg2]
copy
Check syntax only
$ lua -p [script.lua]
copy
Interactive after script
$ lua -i [script.lua]
copy

SYNOPSIS

lua [options] [script] [args]

DESCRIPTION

lua is the Lua programming language interpreter. Lua is lightweight and embeddable.
The tool runs Lua scripts and provides an interactive REPL. Commonly used for game scripting and configuration.

PARAMETERS

SCRIPT

Lua script file.
ARGS
Script arguments.
-e CODE
Execute string.
-i
Interactive mode after script.
-l MODULE
Require module.
-p
Parse only (syntax check).
--help
Display help information.

CAVEATS

Multiple versions exist (5.1-5.4). Some incompatibilities between versions. Embedding varies.

HISTORY

Lua was created in 1993 at PUC-Rio in Brazil, designed as a lightweight embeddable scripting language.

SEE ALSO

luajit(1), luac(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community