lua-users home
lua-l archive

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


On 2017-03-02 16:07, 彭 书呆 wrote:
> well, in my post I mean finer control over environment variables, 
> e.g. I might want to skip the processing of LUA_INIT but keep 
> LUA_PATH/LUA_CPATH.

`LUA_INIT= lua <args>` should do the trick, setting a no-op LUA_INIT
(empty string/program) for that run and retaining LUA_(C)PATH.

Dropping LUA_(C)PATH is harder because of the many per-version
variations, but here `lua -E -e "dofile '${LUA_INIT:1}' <args>"` seems
to work with Bash. (If LUA_INIT points at a file, the ':1' drops the
leading @, leaving the path.)

-- nobody