You should be able to set a trap on CHLD to detect the coprocess
termination.  You can save the pid for the coprocess and then compare that
pid to $! inside the trap since $! is set to the exited pid inside the trap.


On Tue, Oct 8, 2013 at 11:02 AM, Peter Hitchman <[email protected]>wrote:

> Hi
> OK I'll work up a simple example, what I have now is to much to post.
> The background is that I am connecting to an Oracle database using sqlplus
> as a co-process and seeing what happens when for some reason the db
> connection goes away. I found that I had to trap SIGPIPE.
>
> Regards
> Pete
>
>
> On 6 October 2013 13:44, Cedric Blancher <[email protected]>wrote:
>
>> On 6 October 2013 10:36, Peter Hitchman <[email protected]> wrote:
>> > Hi
>> > I am using Version JM 93t+ 2010-06-21 on RHL4.
>> > I have been playing around with a co-process and what happens when the
>> > co-process dies.
>> > What I have found is that to have any control I have to catch SIGPIPE
>> in a
>> > function,
>> > but that I cannot then continue processing outside of this function,
>> all I
>> > can do is exit the script.
>> >
>> > Is this the right way to do it?
>>
>> Do you have any example code which shows what you are trying to do?
>>
>> Ced
>> --
>> Cedric Blancher <[email protected]>
>> Institute Pasteur
>>
>
>
> _______________________________________________
> ast-users mailing list
> [email protected]
> http://lists.research.att.com/mailman/listinfo/ast-users
>
>
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to