Capture command output

Let’s say I use the following function in my C code.

system(“ls”);

Is there a way I can capture the output from this command and not just the
exit status?

I’d appreciate any suggestions.

Shashank

See popen().

dB


“Shashank” wrote ~ Tue, 2 Aug 2005 15:16:35 -0400:

Let’s say I use the following function in my C code.

system(“ls”);

Is there a way I can capture the output from this command and not just the
exit status?

I’d appreciate any suggestions.

Shashank
\