Skip to content

Instantly share code, notes, and snippets.

@chrisbnt
Created March 14, 2011 06:57
Show Gist options
  • Save chrisbnt/868855 to your computer and use it in GitHub Desktop.
Save chrisbnt/868855 to your computer and use it in GitHub Desktop.
Murder - it's killall, but it really means it. Starts with SIGINT, if that doesn't work, tries a SIGQUIT, and if that doesn't work, it pulls out the SIGKILL hammer
#! /bin/bash
SIGNAL="SIGINT"
while killall -${SIGNAL} "$@"; do
if [ $SIGNAL = SIGINT ]; then
SIGNAL="SIGQUIT"
else
SIGNAL="SIGKILL"
fi
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment