Mercurial > hg > config
annotate bin/procenv.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 | 481b55fc4b96 |
children |
rev | line source |
---|---|
342
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
1 #!/bin/bash |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
2 |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
3 # process environment |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
4 # list process environment variables |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
5 |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
6 # must be run as root |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
7 if [[ "$(whoami)" != "root" ]] |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
8 then |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
9 echo "must be run as root" |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
10 exit 1 |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
11 fi |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
12 |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
13 # loop over arguments |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
14 for PROG in $@ |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
15 do |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
16 EXIT=0 |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
17 if PID=$(pidof -x ${PROG}) |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
18 then |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
19 echo '='${PROG}: ${PID}'=' |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
20 cat /proc/${PID}/environ | tr '\000' '\012' | sort |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
21 else |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
22 EXIT=1 |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
23 echo "" |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
24 fi |
481b55fc4b96
added utility to get process env variables
Jeff Hammel <jhammel@mozilla.com>
parents:
diff
changeset
|
25 done |