Mercurial > hg > config
comparison bin/example/pid.sh @ 675:f8813ed3d015
STUB: bin/example/pid.sh
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 06 May 2014 15:18:40 -0700 |
parents | df9d5093573e |
children |
comparison
equal
deleted
inserted
replaced
674:df9d5093573e | 675:f8813ed3d015 |
---|---|
2 | 2 |
3 PID=$$ | 3 PID=$$ |
4 | 4 |
5 echo "The PID of this shell script is ${PID}" | 5 echo "The PID of this shell script is ${PID}" |
6 ps auxwww | grep ${PID} | 6 ps auxwww | grep ${PID} |
7 | |
8 if which tempfile | |
9 then | |
10 PIDFILE=$(tempfile) | |
11 echo "PID file: ${PIDFILE}" | |
12 echo ${PID} > ${PIDFILE} | |
13 kill $(cat ${PIDFILE}) | |
14 fi | |
15 | |
7 kill ${PID} | 16 kill ${PID} |