I would like to start a shell script from LaTeX. In the shell script I need to wait until the .pdf file is generated and afterwards I want to do some stuff with this file.
So I created a MWE Test.tex
like this:
\documentclass{article}
\immediate\write18{/myPath/script.sh}
\begin{document}
Test
\end{document}
The shell script script.sh
looks like this:
#!/bin/bash
until [ -f Test.pdf ]
do
sleep 5
done
echo "File found"
# Do SOMETHING
Unfortunately this seems not to work with TeXMaker. It seems to hang in an endless loop and probably the sleep 5
cmd seems also to let TeXMaker fall asleep.
BTW
--shell-escape
is enabled and chmod 755 script.sh
is set.
EDIT
Now I'm able to use arara
like this in my MWE:
\documentclass{article}
% arara: pdflatex: {shell: yes,synctex: yes,interaction: nonstopmode}
\begin{document}
Test
\end{document}
But how to tell arara
now to run this script \immediate\write18{/myPath/script.sh}
after the pdf is generated?