# Trailing space to end \input| argument

Why do \message{\input|"texlua ..."} and \message{\input|"texlua ..." } give very different results? Notice the extra space before } in the second case.

Minimal example to be compiled with pdftex --shell-escape below.

% Create an empty file \jobname.lua
%
\immediate\openout5\jobname.lua
\immediate\closeout5
%
% Only difference between \A and \B: a trailing space.
% Set \everyeof to allow \input within \edef.
%
\everyeof{\noexpand}
\edef\A{\input|"texlua \jobname.lua"}
\edef\B{\input|"texlua \jobname.lua" }
%
% Display the meanings in the terminal.
%
\newlinechar=10
\message
{%
^^J^^J%
\meaning\A % => macro:->Script file <jobname>.lua
^^J^^J%
\meaning\B % => macro:->\par
^^J^^J%
}
\bye
-
Maybe the " character is active here? Like it is when using [ngerman]{babel} for composing glyphs with a diaeresis ("aä). – Patrick Bergner Aug 2 '12 at 10:30
@PatrickBergner No, it's not that as if you have for example a letter after the closing " then all is fine. I think it's to do with the fact that TeX delimits file names with a space, but can't quite work out why that gives the behaviour seen. – Joseph Wright Aug 2 '12 at 11:24
hmm in an unmodified TL2012 (cygwin) I get \$ luatex --shell-escape in This is LuaTeX, Version beta-0.70.2-2012062812 (TeX Live 2012) \write18 enabled. (./in.tex ! I can't find file |texlua in.lua}'. – David Carlisle Aug 2 '12 at 11:45
@DavidCarlisle This syntax is only available in pdfTeX, as for LuaTeX you are supposed to use the Lua interface. (That is true for several pdfTeX primitives. See most obviously \pdfstrcmp.) – Joseph Wright Aug 2 '12 at 12:29

I would say it is because the quotes are not argument braces, only quotes to guard e.g. spaces. If you run e.g. this:

\input "abc"d

\input "abc" d
\bye

You will get this error messages (assuming of course that the files don't exist):

! I can't find file abcd'.
l.14 \input "abc"d

and

! I can't find file `abc'.
l.16 \input "abc"
d

Also e.g. with xetex \XeTeXinputencoding "utf8"cde will lead to Unknown encoding utf8cde. You must use a space to actually end the input.