lua-users home
lua-l archive

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


在 2017/3/3 9:59, nobody 写道:
> 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
>

thanks for the tips.

as I literally just got to know the -E switch, I didn't think through it.
now I realize I can just use -E to disable default environment processing
and use -e to manually handle what I need.

-- 
the nerdy Peng / 书呆彭 /