I'm running LaTeX on a named pipe fifo on Unix. I create the fifo like-so:
$ mkfifo fifo
I then run LaTeX like-so:
$ latex fifo
This process blocks and has no output until I write to the fifo from another shell:
$ echo "\\end" > fifo
Then the $ latex fifo output becomes:
This is pdfTeXk, Version 3.1415926-1.40.9 (Web2C 7.5.7)
%&-line parsing enabled.
entering extended mode
However, the LaTeX process never ends. How can you get LaTeX to end? I've tried sending it chr(0) and chr(4) (i.e. ctrl-d), but neither works. Is there some command that will tell LaTeX to exit (i.e. something like \exit)?
Thanks for reading.
EDIT:
It is noteworthy that when you run tex instead of a variant of latex then the following works as expected:
$ echo "story\\end" > fifo
(meanwhile, in the tex console)
$ tex fifo
This is TeX, Version 3.1415926 (Web2C 7.5.7)
(./fifo [1] )
Output written on fifo.dvi (1 page, 212 bytes).
Transcript written on fifo.log.
However, although Leslie Lamport notes in A Document Preparation System LaTeX on page 233 that \end has been replaced by \end{document}, neither of the following ends a LaTeX session:
$ echo "\begin{document}story\end{document}"
$ echo "\\begin{document}story\\end{document}"