next up previous contents Next: 6.2.2 Creating Pipes in Up: 6.2
Half-duplex UNIX Pipes Previous: 6.2 Half-duplex UNIX Pipes
6.2.1 Basic Concepts  Simply put, a pipe is a method of
connecting the standard output of one process to the standard
input of another. Pipes are the eldest of the IPC tools, having
been around since the earliest incarnations of the UNIX
operating system. They provide a method of one-way
communications (hence the term half-duplex) between processes.
This feature is widely used, even on the UNIX command line (in
the shell).          ls | sort | lp  The above sets up a
pipeline, taking the output of ls as the input of sort, and the
output of sort as the input of lp. The data is running through a
half duplex pipe, traveling (visually) left to right through the
pipeline.  Although most of us use pipes quite religiously in
shell script programming, we often do so without giving a second
thought to what transpires at the kernel level.  When a process
creates a pipe, the kernel sets up two fi