mkfifo fifo
echo 1 >fifo
blocks on last command.
I find a explanation of this in gnu libc
However, it has to be open at both ends simultaneously before you can proceed to do any input or output operations on it. Opening a FIFO for reading normally blocks until some other process opens the same FIFO for writing, and vice versa.
But
>mkfifo fifo
>exec 5<>fifo
>echo 1 >&5
doesn’t block and works well. Again AFAIK shells use a dup2 to make redirections but
how does this makes a difference?
Actually I find the answer when I formulated the question. I’ll post it below.
Well the answer is short.
From my linux distro
man 7 fifoSo it’s due to
<>in redirection.