1 <!-- $Id: lua.man,v 1.11 2006/01/06 16:03:34 lhf Exp $ -->
4 <TITLE>LUA man page
</TITLE>
5 <LINK REL=
"stylesheet" TYPE=
"text/css" HREF=
"lua.css">
8 <BODY BGCOLOR=
"#FFFFFF">
25 is the stand-alone Lua interpreter.
26 It loads and executes Lua programs,
27 either in textual source form or
28 in precompiled binary form.
29 (Precompiled binaries are output by
33 can be used as a batch interpreter and also interactively.
39 the Lua program in file
41 is loaded and executed.
46 as strings in a global table named
48 If these arguments contain spaces or other characters special to the shell,
49 then they should be quoted
50 (but note that the quotes will be removed by the shell).
54 which contains the string
56 The index of the last argument is stored in
58 The arguments given in the command line before
60 including the name of the interpreter,
61 are available in negative indices in
65 before even handling the command line,
67 executes the contents of the environment variable
77 Otherwise, the string is assumed to be a Lua statement and is executed.
81 and are described below.
84 to signal the end of options.
86 If no arguments are given,
89 is assumed when the standard input is a terminal;
97 reads lines from the standard input,
98 and executes them as they are read.
99 If a line does not contain a complete statement,
100 then a secondary prompt is displayed and
101 lines are read until a complete statement is formed or
102 a syntax error is found.
103 So, one way to interrupt the reading of an incomplete statement is
104 to force a syntax error:
107 in the middle of a statement is a sure way of forcing a syntax error
108 (except inside multiline strings and comments; these must be closed explicitly).
109 If a line starts with
113 displays the values of all the expressions in the remainder of the
114 line. The expressions must be separated by commas.
115 The primary prompt is the value of the global variable
117 if this value is a string;
118 otherwise, the default prompt is used.
119 Similarly, the secondary prompt is the value of the global variable
122 to change the prompts,
123 set the corresponding variable to a string of your choice.
124 You can do that after calling the interpreter
125 or on the command line
126 (but in this case you have to be careful with quotes
127 if the prompt string contains a space; otherwise you may confuse the shell.)
128 The default prompts are "
> " and "
>> ".
132 load and execute the standard input as a file,
135 even when the standard input is a terminal.
137 <B>-e
</B><I>stat
</I>
142 if it contains spaces, quotes,
143 or other characters special to the shell.
146 enter interactive mode after
150 <B>-l
</B><I>name
</I>
152 <B>require
</B>('
<I>name
</I>')
155 Typically used to load libraries.
158 show version information.
162 <A HREF=
"http://www.lua.org/">http://www.lua.org/
</A>
164 Error messages should be self explanatory.