diff 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
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