Skip to content

Instantly share code, notes, and snippets.

@jewel12
Created December 9, 2010 14:18
Show Gist options
  • Save jewel12/734746 to your computer and use it in GitHub Desktop.
Save jewel12/734746 to your computer and use it in GitHub Desktop.
#! /bin/sh
# 親プロセスが死んだら、孤児プロセスを kill する
echo $PPID >&2
while [ ! "`ps --no-headers -p $PPID`" = "" ]
do
sleep 5
done
kill -- -$PPID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment