Shell scripts - getting parent status in read

David Elliott dce at Solbourne.COM
Tue Apr 25 02:16:33 AEST 1989


In article <849 at twwells.uucp> bill at twwells.UUCP (T. William Wells) writes:
>Try enabling SIGPIPE in your parent before calling the shell script.
>When the parent dies, the children trying to read from pipes set up
>by the parent should then get a signal. You might have to use a trap
>command in the shells, though.

Are you sure about this?

SIGPIPE *is* "enabled" in the parent (I just checked).  Generally,
when you execute a program interactively, all signals are set to
SIG_DFL.  Also, SIGPIPE is not a special case, so the default for
it is to cause the program to terminate.

In any case, SIGPIPE means that an attempt was made to write on a
pipe with noone to read it, and that's not what is happening here
(I did say that in the original note, I think).  This is a situation
where a read is being attempted on a pipe with noone on the other
side.  I would think this would cause an EOF, and there was some
discussion on this recently, but it doesn't.

-- 
David Elliott		dce at Solbourne.COM
			...!{boulder,nbires,sun}!stan!dce



More information about the Comp.unix.wizards mailing list