<p>I have kubernetes pod environment variable</p>
<pre><code>JOBID=111
</code></pre>
<p>I am changing this env variable from inside a shell script like below. This change is happening inside an infinite loop. so script never terminates.</p>
<pre><code>export JOBID=$(echo $line)
</code></pre>
<p>Inside the script the value of variable is changed to new value. But if I check the value of the env varible outside the script, inisde a new terminal the value of the env variable is still 111.</p>

user3553913
<blockquote>
<p>Inside the script the value of variable is changed to new value. But if I check the value of the env varible outside the script, inisde a new terminal the value of the env variable is still 111</p>
</blockquote>
<p>This is how environment variables work and you cannot change it. You can only change variable for a specific process, and this env will propagate for every other process you run from this process.</p>
<p>But you cannot overwrite global value. Only the local value (process' copy). Every other process (e.g. started by kubectl exec) will have &quot;old&quot; value of the env variable.</p>
