[tex-live] how to get info about Lua interpreter version from command line

Reinhard Kotucha reinhard.kotucha at web.de
Sat Jun 3 04:15:48 CEST 2017


On 2017-06-02 at 14:59:26 +0200, jfbu wrote:

 > Le 02/06/2017 à 14:49, Philip Taylor a écrit :
 > > 
 > > 
 > > jfbu wrote:
 > >> Hi,
 > >>
 > >> whether I do texlua -v or luatex --credits, I don't get the information
 > >> about which Lua interpreter is used.
 > >>
 > >> How can I get that ?
 > > X:\Users\Philip Taylor.Fujitsu-PC>texlua con
 > > print(_VERSION)
 > > ^Z
 > > Lua 5.2
 > > 
 > 
 > Thanks Philip in the mean time I found the trick of texlua foo.lua
 > with foo.lua a one line file print(lua.version)
 > 
 > no easier way?
 > 
 > (that one can use from a shell script for example)

Dear Jean-François,
nothing is impossible if you're on Unix.

Try this on the command line:

  echo '\directlua{print(lua.version)}\end' | luatex | sed -ne '/^\*\*/s/..\(.*\)/\1/p'

You can use this code in a shell script, of course, and you can even
assign the result to a variable:

  luaversion=$(echo ....)

You have to call luatex because texlua expects a script.  But it
doesn't matter because texlua is a symlink to luatex anyway.

Regards,
  Reinhard

-- 
------------------------------------------------------------------
Reinhard Kotucha                            Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover                    mailto:reinhard.kotucha at web.de
------------------------------------------------------------------



More information about the tex-live mailing list