lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

It was thus said that the Great Enrico Colombini once stated:
> On 26/03/2014 8.57, Sean Conner wrote:
> >#!/usr/bin/env lua -e "if _VERSION ~= 'Lua 5.3' then print('bad lua') 
> >return end" -
> >
> >would work, but apparently not ...
> What happens if the script is launched with a different version of Lua 
> from the one in the path, e.g. it is launched with "test/lua53 
> script.lua" when "/usr/bin/env lua" launches "lua52"?

  The top line is ignored.

[spc]lucy:/tmp>more a.lua
#!/home/spc/apps/lua-5.1/src/lua -e "print('hello')" -

print("good lua!")

[spc]lucy:/tmp>~/apps/lua-5.2/src/lua a.lua
good lua!