diff options
| author | Simon Rettberg | 2013-04-04 18:51:57 +0200 |
|---|---|---|
| committer | sr | 2013-04-12 19:11:41 +0200 |
| commit | 999aa7383d7b43ab2ad0bdca8daa6cc7e0f8f165 (patch) | |
| tree | 3e7f9eeb088ad6371c9c6c7f919f6b70e6de9c55 | |
| parent | Fix Xsession startup, fix polkit+rsyslog on suse (diff) | |
| download | tm-scripts-999aa7383d7b43ab2ad0bdca8daa6cc7e0f8f165.tar.gz tm-scripts-999aa7383d7b43ab2ad0bdca8daa6cc7e0f8f165.tar.xz tm-scripts-999aa7383d7b43ab2ad0bdca8daa6cc7e0f8f165.zip | |
Add penv script to stage32
Use it to see environment variables of a running process.
| -rwxr-xr-x | remote/rootfs/rootfs-stage32/data/usr/sbin/penv | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/remote/rootfs/rootfs-stage32/data/usr/sbin/penv b/remote/rootfs/rootfs-stage32/data/usr/sbin/penv new file mode 100755 index 00000000..ca5a23ac --- /dev/null +++ b/remote/rootfs/rootfs-stage32/data/usr/sbin/penv @@ -0,0 +1,7 @@ +#!/bin/sh + +[ "x$UID" != "x0" ] && echo "You need to be root." && exit 1 +[ "$#" -ne "1" ] && echo "Usage: $0 PID" && exit 1 +[ ! -d "/proc/$1/environ" ] && echo "No such process: $1" && exit 1 +sed 's/\x0/\n/g' "/proc/$1/environ" | grep -E --color=auto '^[^=]*' + |
