diff --git a/shredder.sh b/shredder.sh index d17bfda..c321183 100644 --- a/shredder.sh +++ b/shredder.sh @@ -46,6 +46,10 @@ while true; do for child in ${children}; do activeChildren="${activeChildren} $(ps T | grep $child | awk '{print $1}')" done + + # if no active children, trim the whitespace so we can check for empty string + + activeChildren=$(echo ${activeChildren} | xargs echo) if [ -z "${activeChildren}" ]; then break else