One of our sysadmins recently taught me that we can see the environment with which a process is launched by looking in /proc. Whoa! That’s helpful.
Unfortunately, the environment file is null terminated so not pleasant to read or pipe together with other commands. So here’s a handy one-liner to print them “properly” for easier inspection or command chaining.
cat /proc/{pid}/environ | xargs --null --max-args=1 echo |
#protip #selfreference
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.