Hi,
Try:
$ mkfifo fifo1 fifo2
$ tail -f fifo1 fifo2
Then in another terminal:
$ while true; do /bin/echo aaaa > fifo1; done
and... nothing happens. I would have expected tail(1) to start showing the
content of fifo1 as soon as content became available but no, it just keeps
waiting.
Then in another terminal:
$ while true; do /bin/echo bbbb > fifo2; done
and then tail(1) starts showing output as expected, alternating between
fifo1 and fifo2.
The interesting part is that, once tail(1) has started producing output,
you can interrupt and restart one or both of the "aaaa" and / or "bbbb"
loops and tail(1) always does what you'd expect. It seems that it's only
at the very start that tail(1) doesn't produce any output until content is
available in both fifos.
I tried various things like -n 0 and -c 0 but to no avail.
Another interesting thing to try:
- start the "aaaa" loop
- interrupt the "aaaa" loop
- start the "bbbb" loop
and tail(1) starts displaying output.
But if you try:
- start the "bbbb" loop
- interrupt the "bbbb" loop
- start the "aaaa" loop
then tail(1) still doesn't show any output, until you start the "bbbb" loop
for a second time!
So at the very start, not only does tail(1) seem to expect content in both
fifos before it start showing output, but it also seems to expect the
content to appear in the specific order indicated on the tail(1) command
line.
I assume this is a bug in tail(1)?
Cheers,
Philippe
No comments:
Post a Comment