lua-users home
lua-l archive

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


On 27/07/2011 22.57, Ignacio Burgueño wrote:


On Wed, Jul 27, 2011 at 5:50 PM, Lorenzo Donati
<lorenzodonatibz@interfree.it <mailto:lorenzodonatibz@interfree.it>> wrote:

    Hi all!

    Lately I've been struggling to force Lua interpreter to ignore
    LUA_INIT (on Windows). Since I hate to put shell invocation scripts
    everywhere (.cmd files, I mean) to set LUA_INIT to an empty value,
    I'd like to be able to invoke the interpreter like this:

    lua --noinit myscript.lua

    (I'm thinking to do the mod myself, but maybe this may be useful in
    general and may be worth adding to the standard distro).

    Anyway, if someone has already a smart solution for this problem
    (i.e. that doesn't involve modifying the source), I'll be glad to
    have any pointer.


lua -e"package.path='';package.cpath=''" myscript.lua

Will that do?

It's more verbose than the --init flag, but I think it does what you need.

Tried that, but it solves only the path setting problem. I have other code in the "system-wide" init script pointed to by INIT_LUA, and that code is executed anyway. I'd like to bypass it completely, i.e. prevent its execution.

Moreover I have several builds of lua in my system (one bare-bone PUC-5.1.4, one with a customized interpreter, one 5.2beta, plus several ones used to start specific standalone tools) when testing one of those I always have to wrap the invocation in some .cmd script otherwise LUA_INIT gets in the way. The command line option would simplify things really A LOT.


Regards,
Ignacio

thanks anyway
-- Lorenzo