A bash shell script tool for looking into the process list in a shutdown time script. See: <http://joels-programming-fun.blogspot.jp/2014/08/this-is-demonstration-of-way-to.html>
- #! /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 <search-term> [<limit-count>]"
- 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