How do I prevent a named pipe from closing?
We've found two ways so far:
- Using a loop
while cat myfifo; do :; done
- Using tail
tail -n +1 -f myfifo
What problem are you trying to solve? Open a program that reads the pipe and send the output of several commands to it? like:
mkfifo myfifo cat < myfifo & exec 3>myfifo echo blah >&3 echo more blah >&3 exec 3>&-