Changing the environment variable in the current process

I have a script that exports an environment variable and runs some indexes.

export LOGLEVEL="1"
/home/myuser/bin/myscript1.sh
/home/myuser/bin/myscript2.sh

LOGLEVELavailable to start processes from indexes. How to change an environment variable LOGLEVEL?

I tried to set the variable with export LOGLEVEL="5", but this does not work.

+5
source share
2 answers

In general, you can only affect process environment variables during the start of a process. If you need to report changes to an ongoing process, the environment is not a suitable tool.

, .

: - , LOGLEVEL, SIGHUP SIGHUP.

+11

linux:

strings –a /proc/<pid_of_the_process>/environ

ps eww <pid_of_the_process>
-2

All Articles