Skip to content

Instantly share code, notes, and snippets.

@basith374
Created August 4, 2018 08:38
Show Gist options
  • Save basith374/07de71d412886ed44e84019dff1bcb98 to your computer and use it in GitHub Desktop.
Save basith374/07de71d412886ed44e84019dff1bcb98 to your computer and use it in GitHub Desktop.
get child processes
function getcpid() {
cpids=`pgrep -P $1|xargs`
for cpid in $cpids;
do
echo "$cpid"
getcpid $cpid
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment