Thanks! My usercase: I started a lengthy interactive 'configure' process (say under 'screen'), and then realised I need to always answer 'no' until I see a particular keyword. Seems a waste of time to do this by hand (not to say that I can easily miss the keyword..)
Thus it seems I want to pipe (a copy of) STDERR / STDOUT to a filter,
and also be able to inject into the STDIN of a (console) process,
AFTER it's been started, using command line? Is there a ready-made solution?
The following tools seem help. To capture output, use
strace -ewrite -p $PID
printf '..input..' >/dev/pts/33
Solved in Linux (apparently Linux-specific):
reptyr -s PID
attaches a process to another terminal and/or exposes its input and output as pipes.