Having trouble with fork(), pipe(), dup2() and exec() in C
Even after the first command of your pipeline exits (and thust closes stdout=~fdPipe[1]), the parent still has fdPipe[1] open. Thus, the second command of the pipeline has a stdin=~fdPipe[0] that never gets an EOF, because the other endpoint of the pipe is still open. You need to create a new pipe(fdPipe) for each |, and … Read more