$ mkfifo pipe1
If several lines are put into pipe1
$ (echo line 1; echo line 2) > pipe1
all the lines can be read in another terminal by
$ cat pipe1 line 1 line 2
So far all right.
if instead of the latter cat several partial reads are executed
$ head -n 1 pipe1; head -n 1 pipe1 line 1
then only the first line of the data piped into pipe1 is returned (by the first head -n 1); the rest of the data seems to get lost, the second read access is hanging hence waiting for (new) data available in pipe1.
to set up a named pipe and pipe contents to it in such a way that several consecutive partial reads are possible?
In other words, how to get this:
$ head -n 1 pipe1; head -n 1 pipe1 line 1 line 2