ncdns-repro/tools/container-pids.sh
2021-02-20 23:45:41 +00:00

15 lines
264 B
Bash
Executable File

#!/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