Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • I see, so the shell momentarily switches its STDOUT from the terminal to STDIN for the cat process. then all the rest of the pipe stuff happens, then the shells points its 1 (STDOUT) back to the terminal. And also because processes cat and php are involving IO then they definitely must have file descriptors! Commented May 21, 2016 at 4:10
  • The process that calls exec, in this case the shell, does close and open the file descriptors so they correspond to what is needed in the child process. Commented May 21, 2016 at 4:12