Xref: utzoo comp.unix.questions:31986 comp.unix.misc:1512 alt.sources.patches:33 comp.lang.perl:5589 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!uunet!convex!usenet From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions,comp.unix.misc,alt.sources.patches,comp.lang.perl Subject: Re: tee like program to pipe to another program? Message-ID: <1991Jun06.184927.18367@convex.com> Date: 6 Jun 91 18:49:27 GMT References: <1991Jun6.093939.9346@dartvax.dartmouth.edu> <1991Jun6.134024.26770@leland.Stanford.EDU> <1991Jun06.150109.5469@convex.com> Sender: usenet@convex.com (news access account) Reply-To: tchrist@convex.COM (Tom Christiansen) Followup-To: comp.lang.perl Organization: CONVEX Software Development, Richardson, TX Lines: 23 Nntp-Posting-Host: pixel.convex.com It might be nice to get better than an ungraceful death by SIGPIPE if a pipe kid dies or never gets started. Here's a patch to trap this: 16a17 > $SIG{'PIPE'} = 'PLUMBER'; 37c38 < close($fh) && next; --- > next if close($fh) || !defined $fh{$fh}; 41a43,48 > > sub PLUMBER { > warn "$0: pipe to \"$fh{$fh}\" broke!\n"; > $status++; > delete $fh{$fh}; > } --tom -- Tom Christiansen tchrist@convex.com convex!tchrist "Perl is to sed as C is to assembly language." -me