[tex-live] TeXLive (Windows) bash script -> exe

Zdenek Wagner zdenek.wagner at gmail.com
Mon May 19 18:02:48 CEST 2014


2014-05-19 17:42 GMT+02:00 Ulrike Fischer <news3 at nililand.de>:

> Am Mon, 19 May 2014 15:59:43 +0200 schrieb Mojca Miklavec:
>
> > Yes, you can rewrite the program in lua and execute it with texlua.
>
> > If you write your script in lua, it will be guaranteed to work on all
> > operating systems.
>
> I would love to use texlua to avoid bat and sh-skripts:
>
> http://tex.stackexchange.com/questions/175055/how-to-adapt-a-batch-script-write18-call-to-linux-systems
> )
>
> But is is actually possible to change the current directory with
> lua? And if yes how?
>

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.

>
> And another small question: What extension should one use for such
> lua-scripts .lua or tlu?
>
>
> --
> Ulrike Fischer
> http://www.troubleshooting-tex.de/
>
>
>


-- 
Zdeněk Wagner
http://hroch486.icpf.cas.cz/wagner/
http://icebearsoft.euweb.cz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/tex-live/attachments/20140519/98f89960/attachment.html>


More information about the tex-live mailing list