When I echo something to a named pipe made with mkfifo, it hangs if no process is reading from that pipe. How can I prevent that, i.e., stop that from hanging?
And by the way, why is that hanging echo process not listed in ps -e or pstree?
When I echo something to a named pipe made with mkfifo, it hangs if no process is reading from that pipe. How can I prevent that, i.e., stop that from hanging?
And by the way, why is that hanging echo process not listed in ps -e or pstree?
It's not totally clear what your desired end result is from the question, so I will assume that your desire is to continue the program, but still have the write occur when possible. In that case, just background the operation:
echo foo > fifo &
As for why echo is not listed in the process table, it's because echo is a shell builtin.