annotate bin/example/pid.sh @ 694:ebca6d85213a

File "/usr/lib/python3/dist-packages/IPython/config/__init__.py", line 16, in <module> from .application import * File "/usr/lib/python3/dist-packages/IPython/config/application.py", line 31, in <module> from IPython.config.configurable import SingletonConfigurable File "/usr/lib/python3/dist-packages/IPython/config/configurable.py", line 33, in <module> from IPython.utils.text import indent, wrap_paragraphs File "/usr/lib/python3/dist-packages/IPython/utils/text.py", line 28, in <module> from IPython.external.path import path File "/usr/lib/python3/dist-packages/IPython/external/path/__init__.py", line 2, in <module> from path import * File "/home/jhammel/python/path.py", line 25 print root(path) ^
author Jeff Hammel <k0scist@gmail.com>
date Wed, 09 Jul 2014 16:26:49 -0700
parents f8813ed3d015
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
674
df9d5093573e PID example
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
1 #!/bin/bash
df9d5093573e PID example
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
2
df9d5093573e PID example
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
3 PID=$$
df9d5093573e PID example
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
4
df9d5093573e PID example
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
5 echo "The PID of this shell script is ${PID}"
df9d5093573e PID example
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
6 ps auxwww | grep ${PID}
675
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
7
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
8 if which tempfile
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
9 then
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
10 PIDFILE=$(tempfile)
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
11 echo "PID file: ${PIDFILE}"
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
12 echo ${PID} > ${PIDFILE}
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
13 kill $(cat ${PIDFILE})
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
14 fi
f8813ed3d015 STUB: bin/example/pid.sh
Jeff Hammel <k0scist@gmail.com>
parents: 674
diff changeset
15
674
df9d5093573e PID example
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
16 kill ${PID}