[NTG-context] Equivalent of os.resultof(...) in LaTeX

Herbert Voss Herbert.Voss at FU-Berlin.DE
Mon Nov 3 13:36:55 CET 2014


Am 03.11.2014 um 12:42 schrieb Xan:

> Just short question: what's the equivalent in latex of 
> \ctxlua{context(os.resultof("sha256sum \jobname.conTeXt | cut -c  -5"))}

\documentclass{article}
\begin{document}
\directlua{
 local handle = io.popen("sha256sum \jobname.tex | cut -c -5","r")
 if handle then
   local result = handle:read("*all") or ""
   handle:close()
   tex.print(result)
 end
}
\end{document}


or load l-os.lua, then the command os.resultof is available.

Herbert



More information about the ntg-context mailing list