I know globale linux shell has set of environment variables. And when an application is running it has own set of variables. But how to access them or access their shell. There are ways in some apps. Ex: It can be accessed to snap packages shell with snap run --shell app_name. But if I need to access application like gedit how to do it?
Asked
Active
Viewed 179 times
1
Lakindu Akash
- 1,371
- 1
- 15
- 34
-
1See https://unix.stackexchange.com/q/29128/251553 and the file `/etc/$pid/environ` – PerlDuck May 01 '18 at 10:31
-
2`pgrep gedit` and then see [How do I split a “/proc/*/environ” file in separate lines?](https://askubuntu.com/questions/978711/how-do-i-split-a-proc-environ-file-in-separate-lines) – steeldriver May 01 '18 at 12:00
-
`sudo cat /proc/$(pgrep gedit)/environ | tr '\0' '\n'`? – Cyrus May 01 '18 at 16:21
1 Answers
0
As already answered on comments by our friends
sudo cat /proc/$(pgrep gedit)/environ | tr '\0' '\n'
References:
But it is not worth much as all classic GUI app run same environment accept when user customize a desktop launcher or script and modified it. Which is not the case with snaps.
user.dz
- 47,137
- 13
- 140
- 258