If i do.
mkfifo /tmp/a
echo 'one'>/tmp/a
in the while from another terminal
echo 'two'>/tmp/a
and from a third terminal
more /tmp/a
Why i obtain as output of the last command this?
two
one
|
If i do.
in the while from another terminal
and from a third terminal
Why i obtain as output of the last command this?
|
||||
|
|
|
In
The shell does an The And so will the So at the moment you do To avoid blocking, you could do:
to unlock the pipe first, and then run your commands which won't block until the pipe is full. Note however that the above will work on Linux but not on every Unix or Unix-like. The behaviour when opening a pipe in read-write mode is unspecified by POSIX. |
||||
|
|