Skip to content

Instantly share code, notes, and snippets.

@bmizerany
Created March 31, 2010 05:31
Show Gist options
  • Save bmizerany/349974 to your computer and use it in GitHub Desktop.
Save bmizerany/349974 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Hack process to kill all of it's children when STDIN is closed
# Backstory here: (http://www.trapexit.org/forum/viewtopic.php?p=51315)
#
# Usage: killchildren process-that-wont-kill-children [arg1 arg2 ...]
(cat && kill 0) | $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment