kill only if there are jobs
This commit is contained in:
parent
f24d18ca23
commit
c982ac9fd3
@ -1,4 +1,5 @@
|
|||||||
function g_kill_all_background_jobs {
|
function g_kill_all_background_jobs {
|
||||||
kill -9 $(jobs -p) >/dev/null 2>&1
|
local g_pids
|
||||||
|
readarray g_pids < <(jobs -p)
|
||||||
|
[ -n "${g_pids[0]}" ] && kill -9 ${pids[*]} >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user