LUA5.3(1)

πŸ“¦
version 5.3.6 Β· 2 versions
, in debian bookworm, debian trixie, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ 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 -i is 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:

  1. LUA_INIT_5_3
  2. LUA_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 of name=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. πŸŽ€βœ¨