I would like to get a list of all the processes whose parent is $pid. This is the simplest way I've come up with:
pstree -p $pid | tr "\n" " " |sed "s/[^0-9]/ /g" |sed "s/\s\s*/ /g"
Is there any command, or any simpler way to get the list of children processes?
Thanks!