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