Is it possible to run a simple script inside LuaLaTeX or LaTeX?
For example, I need to use the calculator from the terminal. I'd like to write
$echo "100.83*4.53" | bc
and obtain the result in LuaLaTeX or LaTeX. Is there a command (called \runscript, for instance) that runs a script from within LuaLaTeX or LaTeX and that I could use as follows:
\runscript{echo "100.83*4.53" | bc}
and get "456.7599" as result?
Is it possible, perhaps with some Perl or Python script?
os.execin LuaTeX? Is it practical? – egreg May 18 '13 at 13:09os.exec()is perfect for that task – topskip May 18 '13 at 13:14os.exec()is perfect for the task. As @michal.h21 points out,io.popen()gets the input. – topskip May 18 '13 at 14:05LaTeXsolution is explained here. – g.kov May 18 '13 at 14:29