Reading a Process's Environment
You need the environment variables a running process started with. Where are they?
Choose one answer
In ~/.bashrc of the user running the process.
~/.bashrc
In the output of ps aux, in the last column after the command line.
ps aux
In /etc/environment, which every process copies at start.
/etc/environment
In /proc/PID/environ, separated by NUL bytes.
/proc/PID/environ