mirror of
https://github.com/thegatesbrowser/thegates.git
synced 2025-08-22 23:17:26 -04:00
13 lines
247 B
Bash
13 lines
247 B
Bash
#!/bin/bash
|
|
|
|
extract_child_pid() {
|
|
echo "$(ps --ppid $1)" | grep -oE '^[[:space:]]*[0-9]+' | awk '{print $1}'
|
|
}
|
|
|
|
pid=$1
|
|
while [[ -n "$pid" ]]; do
|
|
pid=$(extract_child_pid "$pid")
|
|
if [[ -n "$pid" ]]; then
|
|
echo "$pid"
|
|
fi
|
|
done
|