Blame | Last modification | View Log | Download
.\" $Id: lua.man,v 1.13 2011/11/16 17:16:53 lhf Exp $.TH LUA 1 "$Date: 2011/11/16 17:16:53 $".SH NAMElua \- Lua interpreter.SH SYNOPSIS.B lua[.I options][.I script[.I args]].SH DESCRIPTION.B luais the standalone Lua interpreter.It loads and executes Lua programs,either in textual source form orin precompiled binary form.(Precompiled binaries are output by.BR luac ,the Lua compiler.).B luacan be used as a batch interpreter and also interactively..LPThe given.I optionsare handled in order and thenthe Lua program in file.I scriptis loaded and executed.The given.I argsare available to.I scriptas strings in a global table named.BR arg .If no options or arguments are given,then.B "\-v \-i"is assumed when the standard input is a terminal;otherwise,.B "\-"is assumed..LPIn interactive mode,.B luaprompts the user,reads lines from the standard input,and executes them as they are read.If a line does not contain a complete statement,then a secondary prompt is displayed andlines are read until a complete statement is formed ora syntax error is found.If a line starts with.BR '=' ,then.B luaevaluates and displaysthe values of the expressions in the remainder of the line..LPAt the very start,before even handling the command line,.B luachecks the contents of the environment variables.B LUA_INIT_5_2or.BR LUA_INIT ,in that order.If the contents is of the form.RI '@ filename ',then.I filenameis executed.Otherwise, the string is assumed to be a Lua statement and is executed..SH OPTIONS.TP.BI \-e " stat"execute statement.IR stat ..TP.B \-ienter interactive mode after executing.IR script ..TP.BI \-l " name"execute the equivalent of.IB name =require(' name ')before executing.IR script ..TP.B \-vshow version information..TP.B \-Eignore environment variables..TP.B \-\-stop handling options..TP.B \-stop handling options and execute the standard input as a file..SH "SEE ALSO".BR luac (1).brThe documentation at lua.org,especially section 7 of the reference manual..SH DIAGNOSTICSError messages should be self explanatory..SH AUTHORSR. Ierusalimschy,L. H. de Figueiredo,W. Celes.\" EOF