SPUG:Broken Pipe

Brian Hatch spug at ifokr.org
Mon Mar 17 13:30:43 CST 2003



> This is sort of a unix question and sort of a perl
> question, but does anybody know how to get rid of the
> annoying Broken Pipe message that occurs when I run a
> system command from within my script and then interrupt
> the system call in the middle. I'm doing a traceroute and
> I want to interrupt the trace if it returns "* * *", but
> when I do that it returns "Broken Pipe".

I don't get any errors running your script on linux or
on solaris.  However you could probably put something like
the following before your code snippet:

$SIG{PIPE} = "IGNORE";

That tells the script to ignore SIGPIPEs.

> Anyone have any ideas why Broken Pipe occurs and how to get rid of it?

Well, if you've run a program from inside your script, it is using a
pipe s.t. your script can get the output from it.  When you kill that
program, the SIGPIPE is sent to let your program know that the
pipe died.



--
Brian Hatch                  "Anything I can do to help?"
   Systems and               "Hmm. Short of dying, no,
   Security Engineer          can't think of a thing."
http://www.ifokr.org/bri/

Every message PGP signed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/spug-list/attachments/20030317/e5a0a26c/attachment.bin


More information about the spug-list mailing list