Mercurial > hg > config
changeset 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 | 1e1bed921c08 |
files | bin/example/pid.sh |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/bin/example/pid.sh Tue May 06 15:12:03 2014 -0700 +++ b/bin/example/pid.sh Tue May 06 15:18:40 2014 -0700 @@ -4,4 +4,13 @@ echo "The PID of this shell script is ${PID}" ps auxwww | grep ${PID} + +if which tempfile +then + PIDFILE=$(tempfile) + echo "PID file: ${PIDFILE}" + echo ${PID} > ${PIDFILE} + kill $(cat ${PIDFILE}) +fi + kill ${PID} \ No newline at end of file