-1
votes

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.

0

2 Answers 2

1
vote

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

program1 | program2
1
vote

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
2
  • 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, 2011 at 6:46
  • If you read the links I provided in my answer you will find the answer.
    – user9517
    Jun 20, 2011 at 6:53

Not the answer you're looking for? Browse other questions tagged .