In computing, process substitution is a form of inter-process communication that allows the input or output of a command to appear as a file.
Process substitution was available as a compile-time option for ksh88, the 1988 version of the KornShell from Bell Labs.
[1] The rc shell provides the feature as "pipeline branching" in Version 10 Unix, released in 1990.
Here is an example using the tee, wc and gzip commands that counts the lines in a file with wc -l and compresses it with gzip in one pass: The main advantages of process substitution over its alternatives are: Under the hood, process substitution has two implementations.
To illustrate the steps involved, consider the following simple command substitution on a system with /dev/fd support: The steps the shell performs are: For named pipes, the execution differs solely in the creation and deletion of the pipe; they are created with mkfifo (which is given a new temporary file name) and removed with unlink.