Index: > A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Business Industries Finance Tax

Home > Pipes and filters


Pipes and filters is a software design pattern invented by Douglas McIlroy; it provides a byte stream communication mechanism between various high-level entities (such as processes) in an operating system.

Its inclusion on the Unix operating system was the first implementation of his vision of software componentry. The main difference between pipes and filters and newer software component technologies is that it only allows information to flow in one direction, like water flows in a pipe.

In the context of Unix operating systems, a pipe signifies that the output of one program feeds directly as input to another program. A file can be used to provide input or to hold the output (in the pipe metaphor, a file would be a container). The Unix shell uses the pipe character (|) to join programs together. A sequence of commands joined together by pipes is known as a pipeline. For creating this mechanism, all Unix tools have access to three distinct special files:

By joining one tool's stdout to another tool's stdin, a pipeline is formed. Errors are sent to a side track and accumulated.

This pattern is extensively used in Unix, but was also ported to DOS, OS/2, Windows NT, BeOS, MacOS X and other operating systems with a text console.

Often filter programA filter program is classically a UNIX program that is designed to be used as part of a pipeline of two or more UNIX utilities. Generally a filter program will read its standard input and write to its standard output and do little else. Conventionally a fs form the constituent programs in a pipeline, performing their bits of data massaging .

An example of a pipeline:

cat * | grep "alice" | grep -v "wonderland" | wc -l

will print out the number of lines in all files in the current directory which contain the text "alice", but not the text "wonderland".

The pipeline has four parts:

Pipes and filters can be viewed as a form of functional programmingFunctional programming is a programming paradigm that treats computation as the evaluation of mathematical functions. In contrast to imperative programming, functional programming emphasizes the evaluation of functional expressions, rather than execution, using byte streams as data objects. This pattern encourages the use of text streams as the input and output of programs. This reliance on text has to be accounted when creating graphic shells to text programs.

Tools like netcatIn computing, Netcat is a network utility for reading from and writing to network connections on either TCP or UDP. It is designed in a thin and simple way, which makes it easy to incorporate in larger applications. Because of its versatility, netcat is a can connect pipes to TCP/IP socketA socket generally designates a cavity or region used for fitting and connecting some specific device. Physical sockets Electrical sockets A CPU socket is a physical and electrical specification of how to connect a CPU to a motherboard. In electronics, as, following the Unix philosophy of "everything is a file".

An attempt to bring together the text-stream interface and hypermedia is XMLTermXMLTerm is both a command line " terminal", like an Xterm, and also a web page, like the one displayed by your browser. XMLterm adds powerful hypertext and graphical capabilities to the Xterm-like terminal interface through its use of the extensible marku, where the input and the output is XMLXML eXtensible Markup Language is a W3C recommendation for creating special-purpose markup languages. It is a simplified subset of SGML, capable of describing many different kinds of data. Its primary purpose is to facilitate the sharing of structured tex and can be interpreted graphically.

Unix Computer terminology



Non User