Re: [NTG-context] Equivalent of os.resultof(...) in LaTeX
On Mon, 3 Nov 2014 14:31:17 +0100
Xan
It does not work:> \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}
Neither this:
\directlua{ require "lualibs-os" tex.sprint(os.resultof("sha256sum \jobname.tex | cut -c -5")) }
Blank. Nothing displayed.
Am 04.11.2014 um 08:55 schrieb Xan:
Xan
ha escrit: It does not work:>
That is not a useful error description ... Herbert \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}
Neither this:
\directlua{ require "lualibs-os" tex.sprint(os.resultof("sha256sum \jobname.tex | cut -c -5")) }
Blank. Nothing displayed.
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
Am 06.11.2014 um 15:51 schrieb Xan:
That is not a useful error description ...
Herbert
More clear than this?
Neither this:
\directlua{ require "lualibs-os" tex.sprint(os.resultof("sha256sum \jobname.tex | cut -c -5")) }
Blank. Nothing displayed.
\directlua{ require "lualibs-os" tex.sprint(os.resultof("sha256sum \jobname.tex")) } \bye luatex --shell-escape <file> will work. Herbert
luatex --shell-escape <file> will work. It works Thanks
participants (2)
-
Herbert Voss
-
Xan