|
Am 26.03.2014 20:36 schröbte Luiz Henrique de Figueiredo:
And, regardless, the man put "elegant" in the title. Presumably that means simple, like the provided examples in the request.How about this? env LUA_INIT='assert(_VERSION=="Lua 5.2")' lua script.lua
Nice idea, but it seems it only works on the command line where we have proper quoting, not as a shebang:
#!/usr/bin/env LUA_INIT='assert(_VERSION>="Lua 5.2")' lua print( "hello from", _VERSION )hangs when called as `./test.lua`. Calling it via `lua test.lua` just skips the shebang obviously ...
Philipp