Hi,

do these have to be pipes? That got me wondering.

Otherwise, I could do a tree-level transform (except the IOREDIR
cases are again slightly more complex). Something like this:

• if <(command2) is contained in command1:
  ‣ allocate a tempfile
    ⇒ attach the tempfile to the list of cleanups of command1
  ‣ run the command2
    ⇒ redirect its stdout to the tempfile
    ⇒ keep stderr and (?) stdin
    ⇒ throw away $? (?)
  ‣ replace <(command2) with the name of the tempfile
  ‣ repeat for any further occurrences
• if >(command3) is contained in command1:
  ‣ allocate a tempfile
    ⇒ attach the tempfile to the list of cleanups of command3
  ‣ replace >(command3) with the name of the tempfile on command1
  ‣ change the TCOM tree command1 to a sequence
    { command1 ; tmpvar=$? ; command3 ; return $tmpvar ; }
  ‣ for any further occurrences command4, … append to the new
    command sequence before the return

Of course, this needs much more careful checking. What does
GNU bash do to stdin, stderr, and the exit codes of the
substituted processes? (Though, strictly spoken, we could
do the above and test it quickly, then change the tempfile
mechanism to spit out FIFOs instead; I’ve done the last step
in an experimental branch already somewhere, so it’s easy.)

bye,
//mirabilos
-- 
I want one of these. They cost 720 € though… good they don’t have the HD hole,
which indicates 3½″ floppies with double capacity… still. A tad too much, atm.
‣ http://www.floppytable.com/floppytable-images-1.html


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to