Although Lua has been designed as an extension language, the language can also be used as a stand-alone interpreter. An implementation of such an interpreter, called simply lua, is provided with the standard distribution. This program can be called with any sequence of the following arguments:
$ lua - a=1 prog.luawill first interact with the user until an EOF, then will set a to 1, and finally will run file prog.lua.
Please notice that the interaction with the shell may lead to
unintended results.
For instance, a call like
$ lua a="name" prog.lua
will not set a to the string "name".
Instead, the quotes will be handled by the shell,
lua will get only a=name to run,
and a will finish with nil.
Instead, one should write
$ lua 'a="name"' prog.lua