1LUA(1) General Commands Manual LUA(1)
2
3
4
6 lua - Lua interpreter
7
9 lua [ options ] [ script [ args ] ]
10
12 lua is the standalone Lua interpreter. It loads and executes Lua pro‐
13 grams, either in textual source form or in precompiled binary form.
14 (Precompiled binaries are output by luac, the Lua compiler.) lua can
15 be used as a batch interpreter and also interactively.
16
17 The given options are handled in order and then the Lua program in file
18 script is loaded and executed. The given args are available to script
19 as strings in a global table named arg. If no options or arguments are
20 given, then -v -i is assumed when the standard input is a terminal;
21 otherwise, - is assumed.
22
23 In interactive mode, lua prompts the user, reads lines from the stan‐
24 dard input, and executes them as they are read. If the line contains
25 an expression or list of expressions, then the line is evaluated and
26 the results are printed. If a line does not contain a complete state‐
27 ment, then a secondary prompt is displayed and lines are read until a
28 complete statement is formed or a syntax error is found.
29
30 At the very start, before even handling the command line, lua checks
31 the contents of the environment variables LUA_INIT_5_3 or LUA_INIT, in
32 that order. If the contents is of the form '@filename', then filename
33 is executed. Otherwise, the string is assumed to be a Lua statement
34 and is executed.
35
37 -e stat
38 execute statement stat.
39
40 -i enter interactive mode after executing script.
41
42 -l name
43 execute the equivalent of name=require('name') before executing
44 script.
45
46 -v show version information.
47
48 -E ignore environment variables.
49
50 -- stop handling options.
51
52 - stop handling options and execute the standard input as a file.
53
55 luac(1)
56 The documentation at lua.org, especially section 7 of the reference
57 manual.
58
60 Error messages should be self explanatory.
61
63 R. Ierusalimschy, L. H. de Figueiredo, W. Celes
64
65
66
67 $Date: 2016/10/17 15:43:50 $ LUA(1)