Determining if there are Zombie processes

This can probably be improved to give a count and/or actually list the processes. As it is, it just lists “State: Z (zombie)” once for each zombie process.

for i in `ls /proc`; do if [[ $i =~ '^[0-9]+$' ]]; then cat /proc/$i/status 2>/dev/null|grep 'State'|grep Z; fi; done