add xargs to properly check for empty activeChildren string
This commit is contained in:
parent
5ae3818ed8
commit
32943a97ba
1 changed files with 4 additions and 0 deletions
|
@ -46,6 +46,10 @@ while true; do
|
||||||
for child in ${children}; do
|
for child in ${children}; do
|
||||||
activeChildren="${activeChildren} $(ps T | grep $child | awk '{print $1}')"
|
activeChildren="${activeChildren} $(ps T | grep $child | awk '{print $1}')"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# if no active children, trim the whitespace so we can check for empty string
|
||||||
|
|
||||||
|
activeChildren=$(echo ${activeChildren} | xargs echo)
|
||||||
if [ -z "${activeChildren}" ]; then
|
if [ -z "${activeChildren}" ]; then
|
||||||
break
|
break
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue