#! /bin/bash # Don't forget to do this: # chmod ug+x,o-rwx findps.sh # Note that bash may be heavier than you want to run at shutdown time. argc=$# limit=10 if ((argc<1)) then echo "Usage $0 []" echo " Default limit count is $limit" exit fi if ((argc>1)) ; then limit=$2 ; fi for (( ct = 0; ct < limit; ++ct )) do ps wwaux | grep $1 sleep 1 done