by CSchenk22. June 2006 03:31
This is a new feature in Beta 11:
TeX's input/output primitives can now be used for unidirectional interprocess communication by prepending a pipe symbol to the file name.
If this feature is enabled, then \input "|command" starts the command interpreter (usually cmd.exe) to carry out the command. The output of the command becomes the input of TeX. For example:
\input "|dir/b"
typesets the file names of the current directory.
Likewise, it is possible to let TeX write something into the input stream of a command. For example:
\immediate\openout1 = "|unix2dos|sort > sorted"
\immediate\write 1 {b}
\immediate\write 1 {a}
\immediate\write 1 {c}
\immediate\closeout1
\input sorted
typesets a b c.
Piped input and output is disabled by default to avoid security problems. You enable the feature by specifying -enable-pipes on the TeX command-line.