Welcome to Ebugg-i.com

Thanks for coming to Ebugg-i.com.

Ad blocker detected


Our website is made possible by displaying online advertisements to our visitors. We need to pay our bills (hosting charges) and we can't do that for free. Please consider supporting us by disabling your ad blocker on our website and whitelist our website.
Please disable ad blocker and reload this web page
Close this message

java ignoring SIGPIPE signal

Posted on: Jun 28 2014 Category :Linux > Ubuntu Views: 1140 | Subscribe


Hi guys,Lets say I have a java process, that just prints out lines and lines of text.I want to head -n 10 that java program, so I do Code:java test | head -n 10This however, does not kill the java process, it hangs instead :Code:root@laptop:/path# java test | head -n 10line line line line line line line line line lineI want to be able to put in something like Code: trap "kill $$" SIGPIPEto kill the java process when the other end of the pipe closesHow would I do this or any better ways of doing it? Thanks in advance.


Post your comments/solution

Get email updates. Virus Removal Tips, News, How to, Threat Alerts.

Bitdefender Antivirus for Mac and PC

Leave a comment!