-1

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.

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
myax
  • 9
  • 1
  • 2

2 Answers2

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