I would like to know how to do something in ant(1) that's equivalent to a particular makefile(4) rule. The makefile(4) rule does the following: 1) starts a process that doesn't terminate and that writes one line to its standard output stream; 2) reads the line from the process; 3) constructs a file using the line; and 4) starts a second process that doesn't terminate using the file as an argument. Schematically, the makefile(4) rule is
program1 | while read arg; do \
echo $$arg >file; \
program2 file; \
done
NOTE: "program1" writes one line; neither "program1" nor "program2" terminates.
How can this be done in ant(1)?