These functions can be used in scripts or interactive shells to manipulate process trees. At least bash version 3.0 is needed. May also work with some earlier versions.
kill_tree - Creates a list of processes based from a parent process ID first then sends the signal to all of them synchronously.
kill_tree_2 - Same as killtree but it doesn't create a list first. It immediately kills processes as it goes through every level.
kill_tree_3 - This version...