Dan Mick wrote:
> Roland Mainz wrote:
> > Danek Duvall wrote:
> >> Roland Mainz wrote:
> >>> Roland Mainz wrote:
> >>>> Does anyone know in which conditions "cat" may return an exit code of
> >>>> "141" when writing to a FIFO ?
> >>> The question wasn't 100% correct. It should be: In which conditions can
> >>> the statement "cat foo.txt >myfifo" return an exit code of "141" (e.g.
> >>> either "cat" or the redirection seems to fail but I am not sure (since I
> >>> am doing remote debugging via email... ;-( )) ?
> >> The exit code indicates that the process caught SIGPIPE.  And write(2) says
> >> that SIGPIPE will be sent to a process that tries to write to a pipe or
> >> fifo that isn't open for reading by any process.  But I presume you knew
> >> that.
> >
> > Right... I hoped that someone knows a more obsure condition which may
> > trigger this exit code...
> 
> So, I don't understand; do you have reason to believe there's no writing
> to a pipe going on, and no possible early child death?

The basic code looks like this (/usr/bin/bsh == original Bourne shell):
-- snip --
#!/usr/bin/bsh
mkfifo smoke_pipe
tail -f smoke_pipe >/dev/null &
cat chicken_monster.txt >smoke_pipe
-- snip --

In theory the "tail -f" should never exit and therefore the exit code
141 for the "cat" line is something I don't understand...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

Reply via email to