Re: bash - pipe



In message <48dcb9f9$0$40316$4fafbaef@xxxxxxxxxxxxxxxxxxx>, Antonio Macchi
wrote:

Trying to reproduce your example:

ldo@theon:~> echo 123 >/tmp/fifo & echo 456 >/tmp/fifo &
[1] 25800
[2] 25801
ldo@theon:~> read -n3 </tmp/fifo; echo $REPLY
123
bash: echo: write error: Broken pipe
ldo@theon:~>
[1]- Done echo 123 > /tmp/fifo
[2]+ Exit 1 echo 456 > /tmp/fifo

The second echo died as soon as the input end of the pipe was closed.


??

I have no errors... and $REPLY is 456


$ uname -r
2.6.24.3vnl

$ echo $BASH_VERSION
3.1.17(1)-release

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

$ echo 123 > /tmp/fifo & echo 456 > /tmp/fifo &
[1] 11408
[2] 11409

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

Did you manage to create an ordinary file called /tmp/fifo?
.



Relevant Pages

  • Re: bash - pipe
    ... bash: echo: write error: Broken pipe ... The second echo died as soon as the input end of the pipe was closed. ... $ uname -r ...
    (alt.os.linux)
  • Re: PATH variable
    ... Floyd L. Davidson wrote: ... >>which should result in echo $PATH ... configuration files before bash invokes /etc/profile ... > come to a single line in a single file that in fact does modify ...
    (comp.os.linux.misc)
  • Re: Bash script - telnet
    ... > I need a telnet script in bash. ... (echo user your_username ... Notice that "echo" preceeds the commands to the remote server. ...
    (comp.unix.questions)
  • Re: Probably very stupid script/bash question
    ... both solutions work perfectly under bash. ... echo "Data received = $E Bytes" ... If the first line has white space, then as many variables as there are "fields" in the line will contain values. ... you must have one or more white spaces between the two 'less than' symbols and NO space between the 'less than' and the 'left parenthesis'. ...
    (Debian-User)
  • Re: Error returns not =?utf-8?q?handled=09correctly=09by=09sysfs=2Ec=3Asubsys=5Fattr=5Fstore?=()
    ... Used /bin/echo instead of the built-in echo command. ... Zsh and Bash both fail. ... AMD running Debian lenny with i686 kernel -- fails. ...
    (Linux-Kernel)