do.c was my first attempt based on the unix 'script' command. this is more powerful but it separates the I/O to and from the app into multiple forks which is not what we want fifo.c was a rewrite once I realised a simpler way of doing it with a combination of popen and a named pipe. however this way requires line at a time IO and no prompts or echoing Note I had to use popen rather than system("... &") because I think the calls to system have no job control the final product may be a hybrid of these two mechanisms - not entirely unlike the 'expect' program (in fact invoking expect from within C might be an easier solution)