You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
264 B
Bash
15 lines
264 B
Bash
4 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
# https://unix.stackexchange.com/a/299198
|
||
|
descendent_pids() {
|
||
|
pids=$(pgrep -P $1)
|
||
|
echo $pids
|
||
|
for pid in $pids; do
|
||
|
descendent_pids $pid
|
||
|
done
|
||
|
}
|
||
|
|
||
|
build_pid=$(pgrep -f '\./build')
|
||
|
echo $build_pid
|
||
|
descendent_pids $build_pid
|