I am new to Shell scripting.How am I supposed to take the output of a c program that i execute and give it as an input to another c program all using shell.

link|improve this question
feedback

closed as off topic by Ward, Iain, Zoredache, Chopper3 Jun 20 '11 at 7:34

Questions on Server Fault are expected to generally relate to servers, networking, or desktop infrastructure, within the scope defined in the faq.

2 Answers

Assuming program1 sends data to stdout and program2 receives data from stdin:

program1 | program2
link|improve this answer
feedback

You need to learn about bash pipes and redirection. In particular to pass the output of one program to the input of another use the | operator

program | another_program
link|improve this answer
I am also asked to take input from a text file and feed it as input to a cprogram and execute it. how? – myax Jun 20 '11 at 6:46
If you read the links I provided in my answer you will find the answer. – Iain Jun 20 '11 at 6:53
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.