terminate.sh 193 B

123456789101112
  1. #!/bin/bash
  2. terminateTree() {
  3. for cpid in $(/usr/bin/pgrep -P $1); do
  4. terminateTree $cpid
  5. done
  6. kill -9 $1 > /dev/null 2>&1
  7. }
  8. for pid in $*; do
  9. terminateTree $pid
  10. done