[NTG-pdftex] [ pdftex-Feature Requests-421 ] \pdf shell escape addition

noreply at sarovar.org noreply at sarovar.org
Mon Jun 12 11:08:52 CEST 2006


Feature Requests item #421, was opened at 2005-08-26 18:32
You can respond by visiting: 
http://sarovar.org/tracker/?func=detail&atid=496&aid=421&group_id=106

Category: None
Group: None
Status: Open
Resolution: Accepted
Priority: 5
Submitted By: ivo welch (iaw4)
Assigned to: Taco Hoekwater (taco)
Summary: \pdf shell escape addition

Initial Comment:

I would humbly request that in addition add to \write18
('--shell-escape'), you add a new command, say \input18
(or \pdftexshellinput18), which like \write18 executes
a system() command on its argument, but which then
pushes the stdout output from this shell command into
the stdin stream that TeX is processing.  (no, writing
to a file and then inputting it does not do the job.)

I cannot contribute to the code base of TeX, which
seems like black magic to me.  But I can offer $300 for
this facility.  If someone was planning to spend the
time to do this anyway, this may push him/her over the
margin.  However, it is important to me that this
enters the standard feature set of pdftex, so that it
will persist through future versions, so this would be
part of the bargain here.

regards,

/ivo welch

----------------------------------------------------------------------

>Comment By: Hans Hagen (hagen)
Date: 2006-06-12 09:08

Message:
Logged In: YES 
user_id=927

it may interest you that taco, fabrice an i have been
playing with piping the last couple of weeks; we're still
struggling with decent ways to get around operating system
related problems; in order for such a feature (actually more
generic that you suggest) to work, it must be cross
platform; btw, one of the reasons why intermediate files
don't work is that it interferes with flushing of files [and
the moment that files are seen] 

Hans 

----------------------------------------------------------------------

Comment By: Taco Hoekwater (taco)
Date: 2006-06-11 13:36

Message:
Logged In: YES 
user_id=1608

Hi Ivo,

Sorry, I had completely forgotten about this. Attached is a
(preliminary?) patch for openclose.c (in the texk/web2c/lib
directory) that gives this functionality.

It is a really simple thing: if the first character of a
filename for \openin or \openout is a pipe symbol (|), the
filename is assumed to be a request for a pipe to a command
line that is given in the rest of the filename. 

Of course, you need "shell_escape = t" in your texmf.cnf
for this to work.

And whether or not this makes it to the distribution(s) is
not up to me, of course.


Have fun, Taco

-------------------
Two small examples:

\openin1= "|ls -l"
\loop \unless \ifeof1
  \read1 to \cs \message{\meaning\cs}
\repeat

\openout1= "|sort >alphabet.tex"
\write1{b}
\write1{a}
\write1{c}
\closeout1
\bye



----------------------------------------------------------------------

Comment By: Nobody (None)
Date: 2006-06-11 02:58

Message:
Logged In: NO 

could you please clarify why "no, writing to a file and then
inputting it does not do the job"?


----------------------------------------------------------------------

Comment By: ivo welch (iaw4)
Date: 2006-06-10 21:05

Message:
Logged In: YES 
user_id=2771


any chance this will happen, taco?  regards, /ivo


----------------------------------------------------------------------

Comment By: Taco Hoekwater (taco)
Date: 2005-08-27 07:01

Message:
Logged In: YES 
user_id=1608

I have an idea on how to do this, so I've assigned it to myself

----------------------------------------------------------------------

You can respond by visiting: 
http://sarovar.org/tracker/?func=detail&atid=496&aid=421&group_id=106


More information about the ntg-pdftex mailing list