executing another program

Hello

I want to run a program that executes another program. It takes the output
of that program as its input, processes it and prints the results. I am not
allowed to use intermediate files. Please suggest.

Hi,

look out for: ipc Inter-process communication - Wikipedia, the free encyclopedia, especially you might find pipes interesting.

hope this helps

What language? Is this a homework question? :slight_smile:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Language? Program2 output example? Depending on the setup there are a
million ways to do this.

Good luck.

Cross_AM wrote:
> Hello
>
> I want to run a program that executes another program. It takes the output
> of that program as its input, processes it and prints the results. I am not
> allowed to use intermediate files. Please suggest.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI1SZD3s42bA80+9kRAjM9AJwMRHhpfhzTHIYtzutejfNs5TEGmACfX7Zv
wmj/wQaTyDwfUMgS5Qw51Cs=
=BeAe
-----END PGP SIGNATURE-----

ab@novell.com wrote:

> Language?
The language I want to use is C. Basically, there is a program that provides
output on the stdout. I want to write another program to process that
output and show the results.

ken yap wrote:

> Is this a homework question?
It is not a homework question. I like trying things on my own. I thought
some work on this now could save me time later.

Monex wrote:

> you might find pipes interesting.
I know it can be done using piping in a shell script. I want to do in C.

Thank you.

By the way, I know that in JAVA I can do it using threads. However, I am not
able to find out how to do it in C. Suggest.

Thank you.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Google-ing for ‘call program c’ gave me the following links:

http://www.gidforums.com/t-3369.html
http://bytes.com/forum/thread128071.html
http://www.tek-tips.com/viewthread.cfm?qid=101113&page=1

Good luck.

Cross_AM wrote:
> By the way, I know that in JAVA I can do it using threads. However, I am not
> able to find out how to do it in C. Suggest.
>
> Thank you.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI1U8w3s42bA80+9kRAsJCAJ9hSvVsN1qWt7/g0iJN8csxU8cdRgCeLdiy
voxKxrKC4c5UjNGBMT6uro4=
=pL4P
-----END PGP SIGNATURE-----

Pipes are also available in C. Look at this book at chapter for ipc Advanced Linux Programming In the book you find also how to use threads.

hope this helps

ab@novell.com wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Google-ing for ‘call program c’ gave me the following links:
>
> http://www.gidforums.com/t-3369.html
> http://bytes.com/forum/thread128071.html
> http://www.tek-tips.com/viewthread.cfm?qid=101113&page=1
>
> Good luck.
>
>
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFI1U8w3s42bA80+9kRAsJCAJ9hSvVsN1qWt7/g0iJN8csxU8cdRgCeLdiy
> voxKxrKC4c5UjNGBMT6uro4=
> =pL4P
> -----END PGP SIGNATURE-----
Thank you. The links were helpful.

Monex wrote:

> In the book you find also how to use threads.
>
I guess I need to do some study before I work on the program.