Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!uakari.primate.wisc.edu!sdd.hp.com!decwrl!shelby!neon!jonas From: jonas@Neon.Stanford.EDU (jonas karlsson) Newsgroups: comp.unix.wizards Subject: Talking to programs Message-ID: <1990Aug3.213540.14476@Neon.Stanford.EDU> Date: 3 Aug 90 21:35:40 GMT Organization: Computer Science Department, Stanford University Lines: 10 How do i call a program from a function, have the function respond to the various prompts, give the correct replies, and catch the output? Someone suggested using socketpairs, fork off a child that dup2's standard in and out into one half of the socketpairs, and then execv'ing the program (basically). I tried following his suggestions, with no success. could someone please give me a detailed description (or code) on how to do this? tnx -j