utility

mkfifo

Create a named pipe. Opening either end can block. Bound both endpoints, collect statuses, and remove only the owned path after use.

Formal Syntax & Structure

bash syntaxbash
mkfifo name

Parameters & Attributes

NameTypeDescription
namepathNew FIFO in an owned directory.

Return Value

exit status

Create a named pipe. Opening either end can block. Bound both endpoints, collect statuses, and remove only the owned path after use.

Working Example

Example Snippetbash
mkfifo channel || exit 1timeout 2s bash -c 'printf "message\n" > channel' &writer=$!timeout 2s cat channelreader_rc=$?wait "$writer"; writer_rc=$?rm -- channel(( reader_rc == 0 && writer_rc == 0 )) || exit 1
Bash Reference