Created
August 31, 2016 12:35
-
-
Save jdarcy/9bfc817568211872ce28a6ea62f44dcb to your computer and use it in GitHub Desktop.
Stray job-killing script
This file contains 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 | |
sleep 10 & | |
sleep 10 & | |
for j in $(jobs | sed -n '/^\[\([0-9]\)\].*/s//\1/p'); do | |
kill %$j | |
wait %$j | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment