Learning pipes, exec, fork, and trying to chain three processes together
问题 I'm learning to use pipes and following along with this code on pipes. The program makes two child processes using fork. The first child runs 'ls' command and outputs to pipe1. The second reads from pipe1 runs 'wc' and outputs to stdout. I'm just trying to add a third process in the middle that reads from pipe1 and outputs to pipe2. Basically what I'm trying to do ls | cat | wc -l What I'm trying to do: (ls)stdout -> pipe1 -> stdin(cat)stdout-> stdin(wc -l) -> stdout Nothing ever prints to