Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
You want to read the error output from a program; for example, you want to capture the system calls displayed by strace(1) .
Redirect standard error to standard output by adding 2>&1 to the command line passed to popen( ). Read standard output by opening the pipe in r mode: