<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-05-19 17:42 GMT+02:00 Ulrike Fischer <span dir="ltr"><<a href="mailto:news3@nililand.de" target="_blank">news3@nililand.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Am Mon, 19 May 2014 15:59:43 +0200 schrieb Mojca Miklavec:<br>
<div class=""><br>
> Yes, you can rewrite the program in lua and execute it with texlua.<br>
<br>
</div><div class="">> If you write your script in lua, it will be guaranteed to work on all<br>
> operating systems.<br>
<br>
</div>I would love to use texlua to avoid bat and sh-skripts:<br>
<a href="http://tex.stackexchange.com/questions/175055/how-to-adapt-a-batch-script-write18-call-to-linux-systems" target="_blank">http://tex.stackexchange.com/questions/175055/how-to-adapt-a-batch-script-write18-call-to-linux-systems</a>)<br>

<br>
But is is actually possible to change the current directory with<br>
lua? And if yes how?<br></blockquote><div><br></div><div>Of course, you can change directory but unix systems behave in a different way (IMHO better way). In DOS, Windows and OS/2 the directory change is permanent so that if a process spawns a child process that changes the current directory, the main process may get confused because suddenly it works in a different directory. In unix systems the working directory is in the process environment. If the process ends, the current directory is reset back to the original value. Thus even if you do even in a script  \immediate\write18{cd somewhere}, it will have no effect and \immediate\write18{something} will execute something in the same working directory. It is necessary to do \immediate\write18{cd somewhere && something} or make a wrapper.<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
And another small question: What extension should one use for such<br>
lua-scripts .lua or tlu?<br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
Ulrike Fischer<br>
<a href="http://www.troubleshooting-tex.de/" target="_blank">http://www.troubleshooting-tex.de/</a><br>
<br>
<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br>Zdenìk Wagner<br><a href="http://hroch486.icpf.cas.cz/wagner/" target="_blank">http://hroch486.icpf.cas.cz/wagner/</a><br><a href="http://icebearsoft.euweb.cz" target="_blank">http://icebearsoft.euweb.cz</a>
</div></div>