Created
October 23, 2015 11:29
-
-
Save mariusgrigaitis/9d2a10b309830f9d6e74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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