ncdns-repro/tools/container-pids.sh

15 lines
264 B
Bash
Raw Normal View History

2021-02-18 20:29:50 +00:00
#!/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