lua-any(1)
β¨ 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 inLua-Versionsis 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
- ubuntu resolute: lua-any 36 Β· MIT
- ubuntu stonking: lua-any 36 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms