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.
Asked
Active
Viewed 587 times
2 Answers
1
Assuming program1
sends data to stdout and program2
receives data from stdin:
program1 | program2

Ignacio Vazquez-Abrams
- 45,939
- 6
- 79
- 84
1
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

user9517
- 115,471
- 20
- 215
- 297
-
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 06:46
-
If you read the links I provided in my answer you will find the answer. – user9517 Jun 20 '11 at 06:53