Skip to content

Instantly share code, notes, and snippets.

@mariusgrigaitis
Created October 23, 2015 11:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
#!/bin/bash
trap handle SIGINT
# run if received
handle()
{
kill -2 $CURRENT_PID
echo -en "\n Exiting Current process [$CURRENT_PID] $?\n"
exit $?
}
python -c "import time; time.sleep(1000)" &
CURRENT_PID=$!
wait "$CURRENT_PID"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment