Skip to content

Instantly share code, notes, and snippets.

@kawanet
Created December 13, 2014 13:29
Show Gist options
  • Select an option

  • Save kawanet/27767189e1e2f2890a08 to your computer and use it in GitHub Desktop.

Select an option

Save kawanet/27767189e1e2f2890a08 to your computer and use it in GitHub Desktop.
bash で自プロセスが落ちたときに子プロセスも一緒に伝搬して落とす
#!/bin/sh
trap "pkill -P $$" EXIT
# do something
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment