LUA5.2(1)
β¨ LUA5.2(1) β the lua girlies' guide β¨
okay bestie, you're looking at the LUA5.2(1) page from the General Commands Manual, and honestly? it's giving iconic. sit down, grab a boba, let's get into it π
πΈ NAME πΈ
lua β the Lua interpreter. that's her. that's the whole vibe. she interprets. π
π¦ SYNOPSIS π¦
lua [ options ] [ script [ args ] ]
like... that's it. that's the whole entrance. she's lowkey simple and that's the point π
π DESCRIPTION π
so lua is the standalone Lua interpreter, and no cap, she's the main character. she loads and executes Lua programs β either in textual source form or in precompiled binary form. (and where do those precompiled binaries come from, you ask? luac, the Lua compiler. she's the one handing out the glow-ups π
) and get this β lua can be used as a batch interpreter and interactively. versatile queen π
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. π«Ά
and here's the little detail that matters: if you give her no options and no arguments, then -v -i is assumed when the standard input is a terminal; otherwise, - is assumed. she knows what you want before you say it, fr fr π
π‘ in interactive mode,luaprompts the user, reads lines from the standard input, and executes them as they are read. if a line doesn't 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. and if a line starts with=, thenluaevaluates and displays the values of the expressions in the remainder of the line. the way that=is just β¨ free real estate β¨
also, before literally anything else β before she even touches the command line β lua checks the contents of the environment variables LUA_INIT_5_2 or LUA_INIT, in that order π and 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. she's thorough. she's prepared. she ate π
π OPTIONS π
-e statβ execute statement stat. just... run it. right now. periodt π-iβ enter interactive mode after executing script. she does the script thing and then she hangs out with you π-l nameβ execute the equivalent ofname=require('name')before executing script. it's the pre-game ritual bestie β¨-vβ show version information. say hi to her name and number π-Eβ ignore environment variables. she's putting her phone on do not disturb π--β stop handling options. that's a wrap on the options section π¬-β stop handling options and execute the standard input as a file. she's done taking notes, she's reading straight from the source π§
π SEE ALSO π
luac(1)- The documentation at lua.org, especially section 7 of the reference manual. go read it, iykyk π
π DIAGNOSTICS π
Error messages should be self explanatory. like she literally tells you what went wrong. read the message babe π
π AUTHORS π
R. Ierusalimschy, L. H. de Figueiredo, W. Celes β the founding mothers/fathers of the whole thing, we stan πΈ
and that's the tea, bestie π this lil love letter was last touched on$Date: 2011/11/16 17:16:53 $and it lives under the nameLUA5.2(1)in your friendly neighbourhood General Commands Manual. go write something cute in Lua. you got this. π¦β¨
π¦ where this page comes from
- debian bookworm: lua5.2 5.2.4-3 Β· MIT
- debian trixie: lua5.2 5.2.4-3+b3 Β· MIT
- ubuntu jammy: lua5.2 5.2.4-2 Β· MIT
- ubuntu noble: lua5.2 5.2.4-3build2 Β· MIT
- ubuntu questing: lua5.2 5.2.4-3build2
- ubuntu resolute: lua5.2 5.2.4-4 Β· MIT
- ubuntu stonking: lua5.2 5.2.4-4 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms