system() does not do anyting with stdout or stdin, and it returns true
or false depending on the command exit code. If you want to collect the
program’s stdin, the easiest way would be to use backquotes:
If you want to collect stderr as well, depending on you system shell you
can do something like:
Or you can deal with forking and exec-ing a command explicitelly, using
pipe() and redirecting stdout/stderr anyway you like (you may also want
to take a look at popen()).