In the script I presented in this question I encountered the following problem. In case of a compilation error, I have to cancel the execution of pdflatex 3 times. This can be very annoying. I would like to add something like
if pdflatex file.tex returned failure break script
However, I could find what values pdflatex returns when it exits. So the question is:
What are the exits/return values/codes of pdflatex?
(pdflatex $$NAME && pdflatex $$NAME && pdflatex $$NAME) || echo Compilation failed– Charles Stewart Nov 26 '10 at 10:540is a standard value for 'success' from almost all processes. – Joseph Wright Nov 26 '10 at 11:17makefile, rather a bash script. I'm not sure how to use you advice. I'm laking knowledge in bashing I guess. – Dror Nov 26 '10 at 11:45$$NAMEto$NAME. What I wrote is nearly equivalent to what Joseph wrote: the "&&" joins together two commands (pipelines) where the one on the right executes only if and after the one on the left exits successfully. The outermost "||" makes a pipeline where the right executes only if and after the left has failed. Try it at the command prompt. – Charles Stewart Nov 26 '10 at 14:21