From 282e4d0cf7163b4459181b58311b31ee5d9313e6 Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Tue, 26 Sep 2023 13:22:00 -0300 Subject: [PATCH] .bashrc added getcpid --- .bashrc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.bashrc b/.bashrc index 8b7a79f..b62605f 100644 --- a/.bashrc +++ b/.bashrc @@ -289,3 +289,11 @@ fi # terraform export TF_PLUGIN_CACHE_DIR="$HOME/.terraform.d/plugin-cache" + +# child process pids +function getcpid() { + cpids=$( pgrep -P $1| xargs ) + for cpid in $cpids; do + getcpid $cpid + done +}