lua-any(1)

πŸ“¦
version 36 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

✨ lua-any β€” the manual, bestie edition ✨

okay so you opened lua-any(1) and you're like "what is this little helper doing in my life" β€” don't worry, I got you. this is the section-1 manual page for lua-any, and by the end of this you're gonna be obsessed. 🫢


🌸 NAME 🌸

lua-any β€” a helper script for multi-Lua-version shebang lines πŸ’…

like, it's the little matchmaker that figures out which Lua you actually meant. no cap.


πŸ¦‹ DESCRIPTION πŸ¦‹

so here's the situation. some Lua scripts work with multiple versions of Lua β€” but not all of them. and because of that, the upstream author of the software may have chosen the loose shebang line:

#!/usr/bin/env lua

and like… valid, sure, but chaotic. 😭

here's the tea: in Debian, /usr/bin/lua is a valid Lua interpreter, but it is under the control of the user, who can set its value to the Lua version of their choice β€” even one that is not able to run the script in question. so your script goes πŸ’€ and you're sitting there like "but it worked on my machine".

enter lua-any: it's a helper that understands metadata written in comments and selects a valid Lua interpreter. iconic behaviour, honestly. example:

#!/usr/bin/env lua-any
-- Lua-Versions: 5.1 5.3

lua-any tests in turn the existence of lua5.1 and lua5.3 and executes the script with the first existing interpreter. first come, first served, main character energy. πŸ‘‘


πŸŽ€ SYNTAX πŸŽ€

lowkey important detail: lua-any looks only at the first 10 lines of the script for metadata β€” i.e. it processes the file trough the head utility. so don't go hiding your Lua-Versions on line 47, bestie, it will simply not see it. πŸ™ˆ

the format of a line is essentially key:value, where leading and trailing spaces are removed from value. the key is matched in a case insensitive way. and the Lua comment, --, must have no leading spaces β€” zero, none, not even one. respect the format, periodt.

the following keys are supported:

  • Lua-Versions β€” space separated list of Lua versions. this is the whole menu, girl.
  • Lua-Root β€” the common root of all interpreters. by default its value is /usr/bin/lua. each Lua version selected in Lua-Versions is simply appended to it in order to obtain the full name of the interpreter. so cute, so predictable. 🧚
  • Lua-Args β€” extra arguments to be passed to Lua interpreters, like -l lfs. by default this is empty. it's giving "optional but powerful".

πŸ’œ DEBIAN NOTES πŸ’œ

a package using lua-any should declare its dependencies on Lua interpreters using a disjunction. example:

Depends: lua-any, lua5.1 | lua5.3

the | is doing the heavy lifting there β€” either one, whichever shows up first. slay. ✨


πŸ‘‘ AUTHOR πŸ‘‘

Enrico Tassi <gareuselesinge@debian.org>

give them their flowers, fr fr. 🌸


and that's the whole page, bestie β€” lua-any, from the lua-any manual, dated 26 February 2026. go forth and shebang responsibly. πŸ«ΆπŸ’–

πŸ“¦ where this page comes from