LUA5.3(1)
β¨ lua β bestie edition β¨
okay so you're looking at the man page for lua, the Lua interpreter β like, from the Lua 5.3 era, hanging out in the General Commands Manual section of your terminal. she's a whole legend, an icon, the moment. let's get into it π
πΈ SYNOPSIS πΈ
lua [ options ] [ script [ args ] ]
that's it. that's the whole vibe. options, maybe a script, maybe some args. slay.
π DESCRIPTION π
okay bestie, here's the tea: lua is the standalone Lua interpreter. she loads and executes Lua programs β either as textual source form or as precompiled binary form. (those precompiled binaries? they get output by luac, the Lua compiler, in case you were wondering π«Ά). and lua can do both jobs: be a batch interpreter and be interactive. she's versatile like that. main character energy fr fr.
so the way it works: the given options get handled in order, and then the Lua program in the file script is loaded and executed. the given args are available to script as strings in a global table named arg. no cap.
and listen β if you give her no options or arguments at all, then:
- if the standard input is a terminal β
-v -iis assumed - otherwise β
-is assumed
π¦ Interactive mode π¦
when you're in interactive mode, lua prompts you, reads lines from the standard input, and executes them as they are read. literally as they come in. π
- if the line contains an expression or a list of expressions β the line gets evaluated and the results are printed
- if a line does not contain a complete statement β a secondary prompt is displayed, and lines keep being read until a complete statement is formed or a syntax error is found π
π§ The very start (before anything else) π§
before she even touches the command line, lua checks the contents of these environment variables, in this exact order:
LUA_INIT_5_3LUA_INIT
if the contents is of the form '@filename', then filename is executed. otherwise, the string is assumed to be a Lua statement and is executed. periodt. β¨
π OPTIONS π
one bullet per flag, all facts intact, let's go:
-e statβ execute the statement stat.-iβ enter interactive mode after executing script.-l nameβ execute the equivalent ofname=require('name')before executing script.-vβ show version information.-Eβ ignore environment variables.--β stop handling options.-β stop handling options and execute the standard input as a file.
π SEE ALSO π
luac(1)- The documentation at lua.org, especially section 7 of the reference manual.
π DIAGNOSTICS π
Error messages should be self explanatory. (she said, confidently. and honestly? she's right. π)
π AUTHORS π
R. Ierusalimschy, L. H. de Figueiredo, W. Celes β the three absolute founders of the whole situation. bows were taken. π«Ά
k that's the whole page bestie, go write something iconic with it. no bugs, only slay. π
and for the cute sign-off: this beauty is stamped $Date: 2016/10/17 15:43:50 $ and lives on the LUA5.3(1) page of the General Commands Manual. iconic era, iconic date, we love to see it. πβ¨
π¦ where this page comes from
- debian bookworm: lua5.3 5.3.6-2 Β· MIT
- debian trixie: lua5.3 5.3.6-2+b4 Β· MIT
- opensuse-leap 16.0: lua53 5.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: lua53 5.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: lua53 5.3.6-160000.3.2 Β· MIT
- opensuse-leap 16.0: lua53 5.3.6-160000.3.2 Β· MIT
- ubuntu jammy: lua5.3 5.3.6-1build1 Β· MIT
- ubuntu noble: lua5.3 5.3.6-2build2 Β· MIT
- ubuntu questing: lua5.3 5.3.6-2build2
- ubuntu resolute: lua5.3 5.3.6-3 Β· MIT
- ubuntu stonking: lua5.3 5.3.6-4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms