Skip to content

Instantly share code, notes, and snippets.

@jdarcy
Created August 31, 2016 12:35
Show Gist options
  • Save jdarcy/9bfc817568211872ce28a6ea62f44dcb to your computer and use it in GitHub Desktop.
Save jdarcy/9bfc817568211872ce28a6ea62f44dcb to your computer and use it in GitHub Desktop.
Stray job-killing script
#!/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