<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 21/06/2022 17:54, Andreas Scherer
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:93556e25-3dc3-33d1-e3a3-00a2ea806538@freenet.de">Dear
TeX hackers,
<br>
<br>
Do you see any chance to replace this working (!) example
<br>
<br>
[snip]<br>
<br>
with the desired compact version
<br>
<br>
\newcount\countD \countD=0
<br>
\ifpdftex \ifnum\pdfshellescape=1
<br>
\countD=\input{|"grep \\\\:\\\\X \jobname.tex | wc -l"}
\fi\fi <br>
</blockquote>
<p><br>
</p>
<p>Is not your fundamental problem that \\, \\\\, etc., are not TeX
escape sequences ? If I were you, I would create a new TeX escape
character (e.g., !), then re-catcode \ such that it does not
require escaping. Something along the lines of :</p>
<p><tt>\newcount \countD <br>
\countD = 0</tt><tt><br>
</tt><tt>\ifpdftex <br>
\ifnum \pdfshellescape = 1<br>
\begingroup<br>
\catcode `\! = \catcode `\\<br>
\catcode `\\ = \catcode `\@<br>
!global !countD = !input {|"grep \\\\:\\\\X
!jobname.tex | wc -l"}<br>
\endgroup<br>
\fi<br>
\fi <br>
</tt></p>
<p>E & OE, of course.</p>
<p>-- <br>
<i>Philip Taylor</i><br>
</p>
<p><br>
</p>
</body>
</html>