Re: command output to variables

"Xin Zou" <[email protected]>
Newsgroups org.kernel.vger.linux-c-programming
Message-ID <[email protected]>
It's not easy to get output in C.
You can use pipe to get the result from standard output.

On Wed, Jan 7, 2009 at 8:35 PM, Jai Sharma <[email protected]> wrote:
> Hi All
>
> I m PHP, Perl programmer , but finally I need C to program in LInux.
> In perl I simply use `` operator to get command output.
>
> $who_output = `who` ;
>
>
> but in C , how can i get the output. Using system function i m easily
> run the command. But how to get its output .
>
> system("who");
>
> Plz help
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.