6. Basic Interprocess Communication
Now that we know how to create processes, we want to connect them so they can communicate. We’ll do this with pipes in this chapter, using basic techniques that have always worked on all versions of UNIX. In the next chapter we’ll start exploring interprocess communication using techniques that are more efficient and robust, less universally available, and more troublesome to program.
Pipes are familiar to most UNIX users as a shell facility. For instance, to display a sorted list of who’s logged in, you can type:
$ who | sort | more
There are three processes here, connected with two pipes. Data flows in one direction only, from
more. It’s also possible to set up pipelines ...