bash - pipe



hi

I can't understand this pipe-behavior..

------------------

$ mkfifo fifo

$ echo 123 > fifo &
[1] 7535

$ echo 456 > fifo &
[2] 7536

$ read -n3 < fifo
[1]- Done echo 123 >fifo
[2]+ Done echo 456 >fifo

$ read -n3 < fifo

(hang! - empty pipe)


--------------------


More than one process can append his output to a pipe

but...

Only one process can read a pipe
When he has fished, no more processes can read remaining-data


It seems illogical....
.



Relevant Pages

  • Re: bash - pipe
    ... $ read -n3 < fifo ... More than one process can append his output to a pipe ...
    (alt.os.linux)
  • Re: Redirect an Pipe
    ... in die Pipe eines Hintergrundprozesses schreiben. ... in einem Block zu fassen? ... | mkfifo FIFO ...
    (de.comp.os.unix.shell)
  • Re: Redirect an Pipe
    ... Nikolaus Rath writes: ... in die Pipe eines Hintergrundprozesses schreiben. ... | mkfifo FIFO ... Wenn Sie mir E-Mail schreiben, stellen | When writing me e-mail, please ...
    (de.comp.os.unix.shell)
  • Re: fork process to handle fifo input
    ... >> work on the input of the named pipe. ... >> process in order to collect to child processes before quiting. ... >> collect data from syslog through the fifo as they should. ...
    (comp.lang.perl.misc)
  • how to tell FIFO (named stream pipe) size
    ... How can I tell what size a FIFO is? ... I am under these impressions: ... the pipe, then the write is guaranteed to be atomic, thus the byte ... service reads from many child processes, ...
    (comp.unix.programmer)