1 .\" $Id: lua.man,v 1.11 2006/01/06 16:03:34 lhf Exp $
2 .TH LUA 1 "$Date: 2006/01/06 16:03:34 $"
18 is the stand-alone Lua interpreter.
19 It loads and executes Lua programs,
20 either in textual source form or
21 in precompiled binary form.
22 (Precompiled binaries are output by
26 can be used as a batch interpreter and also interactively.
32 the Lua program in file
34 is loaded and executed.
39 as strings in a global table named
41 If these arguments contain spaces or other characters special to the shell,
42 then they should be quoted
43 (but note that the quotes will be removed by the shell).
47 which contains the string
49 The index of the last argument is stored in
51 The arguments given in the command line before
53 including the name of the interpreter,
54 are available in negative indices in
58 before even handling the command line,
60 executes the contents of the environment variable
70 Otherwise, the string is assumed to be a Lua statement and is executed.
74 and are described below.
77 to signal the end of options.
79 If no arguments are given,
82 is assumed when the standard input is a terminal;
90 reads lines from the standard input,
91 and executes them as they are read.
92 If a line does not contain a complete statement,
93 then a secondary prompt is displayed and
94 lines are read until a complete statement is formed or
95 a syntax error is found.
96 So, one way to interrupt the reading of an incomplete statement is
97 to force a syntax error:
100 in the middle of a statement is a sure way of forcing a syntax error
101 (except inside multiline strings and comments; these must be closed explicitly).
102 If a line starts with
106 displays the values of all the expressions in the remainder of the
107 line. The expressions must be separated by commas.
108 The primary prompt is the value of the global variable
110 if this value is a string;
111 otherwise, the default prompt is used.
112 Similarly, the secondary prompt is the value of the global variable
115 to change the prompts,
116 set the corresponding variable to a string of your choice.
117 You can do that after calling the interpreter
118 or on the command line
119 (but in this case you have to be careful with quotes
120 if the prompt string contains a space; otherwise you may confuse the shell.)
121 The default prompts are "> " and ">> ".
125 load and execute the standard input as a file,
128 even when the standard input is a terminal.
135 if it contains spaces, quotes,
136 or other characters special to the shell.
139 enter interactive mode after
145 .BI require(' name ')
148 Typically used to load libraries.
151 show version information.
157 Error messages should be self explanatory.