Possible Duplicate:
Is it possible to have pipe between two child processes created by same parent (LINUX, POSIX)
I want to create a program in C. This program has to be able to do the same that piping 2 linux commands do.
For Example:
ps aux | grep ssh
I need to be able to do this command in a c script.
I know I can use, fork
, pipe
, exec
and dup
but I don't quite know how to put them together...
Can someone help me with this?