[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LUA_INIT can replace require
- From: nobody <nobody+lua-list@...>
- Date: Fri, 3 Mar 2017 02:59:55 +0100
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