linux program issue - Suse

This is a discussion on linux program issue - Suse ; Does anyone know how to capture the normal terminal output of a program called from a 'C' program system() call? I want to get the output of pstree from within my program. example: returnval = system("pstree"); How can I capture ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: linux program issue

  1. linux program issue

    Does anyone know how to capture the normal terminal output of a program
    called from a 'C' program system() call?

    I want to get the output of pstree from within my program.

    example: returnval = system("pstree");

    How can I capture the output of pstree that would normally show up in
    the terminal window?

    Thanks

  2. Re: linux program issue

    George wrote:
    > Does anyone know how to capture the normal terminal output of a program
    > called from a 'C' program system() call?
    >
    > I want to get the output of pstree from within my program.
    >
    > example: returnval = system("pstree");
    >
    > How can I capture the output of pstree that would normally show up in
    > the terminal window?
    >
    > Thanks


    man popen

  3. Re: linux program issue

    Chris Cox wrote:
    > George wrote:
    >> Does anyone know how to capture the normal terminal output of a program
    >> called from a 'C' program system() call?
    >>
    >> I want to get the output of pstree from within my program.
    >>
    >> example: returnval = system("pstree");
    >>
    >> How can I capture the output of pstree that would normally show up in
    >> the terminal window?
    >>
    >> Thanks

    >
    > man popen



    Thanks, that did it!

+ Reply to Thread