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
It's not that clean (shows lines like: write(#,) ), but works! But does it say handle UTF8 correctly?
To redirect the output, do something like
printf '..input..' >/dev/pts/33
But it is not clear how to find the right device..