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.
killtree - Creates a list of processes based from a parent process ID first then sends the signal to all of them synchronously.
killtree2 - Same as killtree but it doesn't create a list first. It immediately kills processes as it goes through every level.
killtree3 - This version kills...