title: Get System Environmental Variables In C
body: <p>I've written an application in C that is supposed to be reading environmental variables and handling those changes appropriately.  When the application starts, I've set it up to go ahead and initialize the variable (to prevent any null pointers from returning) via <code>setenv("MYVARIABLE", "TEST", 1)</code>.</p>
  
  <p>This application loops often and, during those loops, one of its jobs is to check that global variable via <code>getenv("MYVARIABLE")</code>.</p>
  
  <p>The plan then was to have either a shell script or a python script change these environmental variables.  The C application is full screen, so I have no way of testing this process without another terminal entry.  In my other terminal (<em><code>c2</code></em>) I run commands such as:</p>
  
  <pre><code>MYVARIABLE="My New Value"
  </code></pre>
  
  <p>or</p>
  
  <pre><code>export MYVARIABLE="My New Value"
  </code></pre>
  
  <p>My application doesn't seem to catch the environmental update, though.  Instead it continues to insist that MYVARIABLE is "test," and not "My New Value."  I'm not sure why these two environments are separate, but I need them to work together.  Does anyone know what I'm doing wrong?</p>
  
  <p>My system is running Archlinux for anyone who is interested</p>