Skip to content

Instantly share code, notes, and snippets.

@mariusgrigaitis
Created October 23, 2015 11:29
Show Gist options
  • Save mariusgrigaitis/9d2a10b309830f9d6e74 to your computer and use it in GitHub Desktop.
Save mariusgrigaitis/9d2a10b309830f9d6e74 to your computer and use it in GitHub Desktop.
#!/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