I am writing a simple shell and I would like to implement a pipes.
So, let's consider:
<command1> | <command2> | <command3> | ...
Now, my idea is:
Start command1 and waitpid for him. Then run command2 and waitpid for him. And so on.
Is it a good idea?
How to implement?:
<command1> | <command2> | <command3> &