[tex-k] exit code and --interaction
mpg at elzevir.fr
Thu Oct 30 22:56:02 CET 2008
Karl Berry a écrit :
> Your examples are garbled in the email, for instance, this doesn't make
> mpg at roth:~% echo '\\relax hi\n \\bye' | pdftex
> \bye' | pdftexThis is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
Hum, this as it appears in my terminal. Maybe my shell and/or terminal
is doing something nasty. (For the record, I'm using zsh in a urxvt.)
> $ echo '\relax hi \bye' | pdftex
> with and without --interaction=batchmode and both exited 0.
> (I also tried some erroneous constructs and both exited 1.)
I realise I forgot to mention the important point: I observe the strange
behaviour only with newlines in the echoed string.
I originally noticed it in a Perl script, doing something like :
$source = <<EOF;
# $source =~ s/\n/ /g; # workaround
$pb = system("echo '$source' | pdftex --interaction=batchmode");
Uncommenting the workaround line make things work again.
> In any case, using an actual input file to try to find the problem case
> would be more reliable; stdin behavior can be rather inscrutable.
The point is I never had any problem with an input file. But in this
script I thought not using temporary files would be simpler (compiling
many similar files).
> The .log file might also shed some light.
Oh yes, there it is:
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7) (format=pdftex
2008.10.18) 30 OCT 2008 22:48
entering extended mode
%&-line parsing enabled.
! Emergency stop.
*** (job aborted, no legal \end found)
! ==> Fatal error occurred, no output PDF file produced!
More information about the tex-k