Platform-Independent Asynchronous Child Process IPC
Spawning subprocesses and catching their standard output and standard error channels sounds like a trivial task but it is somewhat tricky to make it also work on Windows because of the platform's numerous quirks. It is, however, feasible, as the instructions below show. Code is provided for both C and Perl. You should be able to port it to other scripting languages without major problems.