add xargs to properly check for empty activeChildren string
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAl4KNhIACgkQO3+8IhRO Y5hSyhAAjdtJWSlauLwrIoplG14WiF4x0YEcitlY6UVsSsE5+a6l+iElv/Lp1HVB qU9JMcEgdayXI99vM+2o+/LEB9qaF+dEJV1gvcJYxJ9lb7wxxZWTb+Qd9wwFbQXA mTnxbfJNHXCtPNrIJSvUdMIEZrqv8y8cUNXr8rk69cPoUBZjxRudPJnYAAYbElC+ GXl1EC0Q2xcfPzJb52l57y66J/xRA2GLs3YYlKtVvRPRDT2UDOnXzfWviycXFi27 lgWZH9XzJlMe/AaDvkpTKvFTsIrKzLL4MHUM0iK+U7YCGM9M4DqfbOEE3I0LU2DG tb3FnVZi+M/0hMdKo/MAGSx6MDuBRnCEKkiWGSR/P3h8edTiOnIJkYjeeg9Dgvxq C+F7ELUpEfZDiF/BEpVuJgTD9G4TzMNc84vjP+hCq5ADZgpzxVmZbwycE8URj+4A cWqMZKLRjpHYBQIHsbzPlplq1CjnoQwdUuyYx841K9GS9MOQiisfVPbkKEBy2jwB z9+b8dKQCFTjCaF9nj3wqAcGSKiw/oyCFGMXemZWYpOLOsyauhVTFcqk9D4suRSa 89qbPHbzlyAUFQKb79LOCVhYlYnp5Pi7Y7GEzJVvSug5PU0Ny464sFxRyREPSrgS br3N5A4KoOnWck1eaeHfvFyengFH1REjV6fcuvEZSQaWc7EtBfY= =oxHA -----END PGP SIGNATURE-----
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
shredder.sh
→
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