Reputation: 63
I am running a program called argus which sniffs packets and extracts some features from every flow of packets and prints them to the terminal. the output is continuous and won't stop until you kill the process.
I am trying to redirect this output to a program written in c. I would like to execute a set of tests on every line obtained from the sniffing program.
How can i redirect the continuous output of the sniffing program and input it to the processing program?
Upvotes: 0
Views: 346
Reputation: 40894
Read stdin in your program.
Then use a shell pipe to redirect the stdout of one command to the input of another:
sniffer | ./your_program
Upvotes: 2