This commit is contained in:
olli 2024-07-02 21:35:33 +02:00
parent 3c42aff8f5
commit fd8ad9799b

View File

@ -8,13 +8,12 @@ function g_kill_all_background_jobs {
then
kill -9 ${g_pids[*]} >/dev/null 2>&1
else
local g_cmdline=$1
local g_cmdline="$1"
local g_proc
local g_pid
for g_pid in "${g_pids[@]}"
do
echo $g_pid
readarray g_proc < "/proc/$g_pid/cmdline"
read g_proc < <(tr "\0" " " < /proc/${f_pid}/cmdline)
[ "$g_proc" = "$g_cmdline" ] && kill -9 $g_pid >/dev/null 2>&1
done
fi