LUA(1)                      General Commands Manual                     LUA(1)



NNAAMMEE
       lua - Lua interpreter

SSYYNNOOPPSSIISS
       lluuaa [ _o_p_t_i_o_n_s ] [ _s_c_r_i_p_t [ _a_r_g_s ] ]

DDEESSCCRRIIPPTTIIOONN
       lluuaa  is the standalone Lua interpreter.  It loads and executes Lua pro‐
       grams, either in textual source form or  in  precompiled  binary  form.
       (Precompiled  binaries  are output by lluuaacc, the Lua compiler.)  lluuaa can
       be used as a batch interpreter and also interactively.

       After handling the _o_p_t_i_o_n_s, the Lua program in file  _s_c_r_i_p_t  is  loaded
       and  executed.  The _a_r_g_s are available to _s_c_r_i_p_t as strings in a global
       table named aarrgg and also as  arguments  to  its  main  function.   When
       called  without  arguments,  lluuaa  behaves  as lluuaa --vv --ii if the standard
       input is a terminal, and as lluuaa -- otherwise.

       In interactive mode, lluuaa prompts the user, reads lines from  the  stan‐
       dard  input,  and executes them as they are read.  If the line contains
       an expression, then the line is evaluated and the  result  is  printed.
       If  a  line  does  not  contain  a complete statement, then a secondary
       prompt is displayed and lines are read until a  complete  statement  is
       formed or a syntax error is found.

       Before  handling  command line options and scripts, lluuaa checks the con‐
       tents of the environment variables LLUUAA__IINNIITT__55__44 and LLUUAA__IINNIITT,  in  that
       order.   If  the contents are of the form '@_f_i_l_e_n_a_m_e', then _f_i_l_e_n_a_m_e is
       executed.  Otherwise, the contents are assumed to be  a  Lua  statement
       and is executed.  When LLUUAA__IINNIITT__55__44 is defined, LLUUAA__IINNIITT is ignored.

OOPPTTIIOONNSS
       --ee _s_t_a_t
              execute statement _s_t_a_t.

       --ii     enter interactive mode after executing _s_c_r_i_p_t.

       --ll _n_a_m_e
              require library _n_a_m_e into global _n_a_m_e.

       --vv     show version information.

       --EE     ignore environment variables.

       --WW     turn warnings on.

       ----     stop handling options.

       --      stop handling options and execute the standard input as a file.

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       The  following environment variables affect the execution of lluuaa.  When
       defined, the version-specific variants take priority and  the  version-
       neutral variants are ignored.

       LLUUAA__IINNIITT,, LLUUAA__IINNIITT__55__44
              Code to be executed before command line options and scripts.

       LLUUAA__PPAATTHH,, LLUUAA__PPAATTHH__55__44
              Initial  value  of  package.cpath,  the  path used by require to
              search for Lua loaders.

       LLUUAA__CCPPAATTHH,, LLUUAA__CCPPAATTHH__55__44
              Initial value of package.cpath, the  path  used  by  require  to
              search for C loaders.

EEXXIITT SSTTAATTUUSS
       If  a  script calls os.exit, then lluuaa exits with the given exit status.
       Otherwise, lluuaa exits with EXIT_SUCCESS (0 on POSIX  systems)  if  there
       were no errors and with EXIT_FAILURE (1 on POSIX systems) if there were
       errors.  Errors raised in interactive mode do not cause exits.

DDIIAAGGNNOOSSTTIICCSS
       Error messages should be self explanatory.

SSEEEE AALLSSOO
       lluuaacc(1)
       The documentation at lua.org, especially section  7  of  the  reference
       manual.

AAUUTTHHOORRSS
       R. Ierusalimschy, L. H. de Figueiredo, W. Celes



                         $Date: 2020/05/21 19:31:21 $                   LUA(1)
