diff --git a/articles/pipe.md b/articles/pipe.md index 4eb704f..fe88ddc 100644 --- a/articles/pipe.md +++ b/articles/pipe.md @@ -1,19 +1,19 @@ # Pipe A pipe is an unidirectional IPC mechanism used first in the [Unix](unix.md) operating system, used to connect one -or multiple processes (then forming a pipeline). Pipes are a central concept in Unix-like operating systems as it +or multiple processes together (then forming a pipeline). Pipes are a central concept in Unix-like operating systems as it allows the composition of multiple programs results without using temporary files. In a shell a pipeline is constructed using the `|` character which by default redirect the process stdout output to the stdin of the process at the right of the pipe. ```sh -A | B | C | D +cmdA | cmdB | cmdC | cmdD ``` ## Named pipes A named pipe also known as a FIFO, is a pipe that is represented as a file on a disk having similar semantics to a regular file. ```sh -mkfifo foo -cat foo & -echo 'test' > foo +mkfifo foo # create named pipe +cat foo & # will block until something is written to it +echo 'test' > foo # send data through the pipe ```