Can someone post a simple example of using named pipes in Bash in Linux?
Here are the commands:
$ mkfifo named_pipe
$ echo "Hi" > named_pipe &
$ cat named_pipe
The first command creates the pipe.
The second command writes to the pipe (blocking). The & puts this into the background so you can continue to type commands in the same shell. It will exit when the FIFO is emptied by the next command.
The last command reads from the pipe.