Sophie

Sophie

distrib > Mandriva > 8.1 > i586 > by-pkgid > 9b4a1179a1f62ee8c416b1670e1442ae > files > 14

lua4-4.0-3mdk.i586.rpm

<!-- lua.man,v 1.3 2000/09/04 21:41:28 lhf Exp -->
<HTML>
<HEAD>
<TITLE>LUA man page</TITLE>
</HEAD>

<BODY BGCOLOR="#FFFFFF">

<H1>NAME</H1>
lua - Lua interpreter
<H1>SYNOPSIS</H1>
<B>lua</B>
[
<I>arguments</I>
]
<H1>DESCRIPTION</H1>
<B>lua</B>
is the stand-alone Lua interpreter.
It loads and executes Lua programs,
either in textual source form or
in precompiled binary form,
as output by
<B>luac</B>,
the Lua compiler.
<B>lua</B>
can be used as a batch interpreter and also interactively.
<P>
The
<I>arguments</I>
can be options, assignments, or filenames,
and are processed in order,
from left to right.
<P>
Options start with
<B>-</B>
and are described below.
<P>
An assignment is an argument of the form
<B>a=b</B>,
which assigns the string
.RB ` b '
to the global variable
<B>a</B>.
Note that no quotes are needed around the string if it does not contain spaces
or other characters special to the shell.
This is for convenience only.
(In general,
you should be careful when using quotes and spaces on the command line
because they are usually handled by the shell.)
<P>
If the argument is neither an option nor an assignment,
then it is assumed to be a filename,
which is then loaded and executed.
<P>
If no arguments are given,
then
<B>"-v -i"</B>
is assumed when the standard input is a terminal;
otherwise,
<B>-</B>
is assumed.
<H1>OPTIONS</H1>
<P>
<B>-</B>
load the standard input as a file,
that is,
not interactively,
even when the standard input is a terminal.
<P>
<B>-c</B>
close Lua before exiting.
<P>
<B>-e "</B><I>stat"</I>
execute statement
<I>stat</I>.
You will need to quote
<I>stat </I>
if it contains spaces or quotes.
<P>
<B>-f "</B><I>file"</I>
collect all remaining arguments as strings into a global table named
<B>arg</B>
and then execute
<I>file</I>.
The arguments in
<B>arg</B>
start at 0,
which contains the string
.RI ` file '.
The index of the last argument is stored in
<B>"arg.n"</B>.
<P>
<B>-i</B>
enter interactive mode,
displaying a prompt.
In this mode,
<B>lua</B>
reads lines from the standard input and executes them as they are read.
Each line must contain a complete statement.
To span a statement across several lines, end each line with a backslash
<B>`\e'</B>.
The prompt shown is the value of the global variable
<B>_PROMPT</B>,
if this value is a string.
So,
to change the prompt,
set
<B>_PROMPT</B>
to a string of your choice.
You can do that after calling the interpreter
or on the command line with
<B>"_PROMPT=\'lua: \'"</B>,
for example.
(Note the need for quotes, because the string contains a space.)
The default prompt is ``&gt; ''.
<P>
<B>-q</B>
enter interactive mode,
but without displaying a prompt.
<P>
<B>-s</B><I>n</I>
set the stack size to
.IB n .
If present,
this must be the first option.
Note that
<I>n</I>
is in the same argument as
<B>-s</B>.
For example,
to specify a stack size of 2000,
use
<B>-s2000</B>.
<P>
<B>-v</B>
print version information.
<H1>SEE ALSO</H1>
<B>luac</B>(1)
<BR>
<A HREF="http://www.tecgraf.puc-rio.br/lua/">http://www.tecgraf.puc-rio.br/lua/</A>
<H1>DIAGNOSTICS</H1>
Error messages should be self explanatory.
<H1>AUTHORS</H1>
R. Ierusalimschy,
L. H. de Figueiredo,
and
W. Celes
(<A HREF="mailto:lua@tecgraf.puc-rio.br">lua@tecgraf.puc-rio.br</A>)
<!-- EOF -->
</BODY>
</HTML>