Newbie: getting output of system(" ") command. - Unix

This is a discussion on Newbie: getting output of system(" ") command. - Unix ; How can I get the output of a system() command into my (Linux GUI) program? ie int system(const char * string ); For example, if I want to do a ls command, ie system("ls") or system("myTextProducingProgram") from within my program, ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Newbie: getting output of system(" ") command.

  1. Newbie: getting output of system(" ") command.

    How can I get the output of a system() command into my (Linux GUI) program?

    ie int system(const char * string );

    For example, if I want to do a ls command, ie system("ls") or
    system("myTextProducingProgram") from within my program, and
    I want to get text output of the called program in my program.

    Thanks!



    --
    Posted via a free Usenet account from http://www.teranews.com


  2. Re: Newbie: getting output of system(" ") command.

    "Andrew Glass" wrote:

    > How can I get the output of a system() command into my (Linux GUI)
    > program?
    >
    > ie int system(const char * string );
    >
    > For example, if I want to do a ls command, ie system("ls") or
    > system("myTextProducingProgram") from within my program, and
    > I want to get text output of the called program in my program.
    >
    > Thanks!
    >
    >
    >


    Look into popen().

+ Reply to Thread