title: How do I set an environment variable on a Team Foundation Server private macos agent?
body: <p>I am trying to run a build on TFS.  One of the steps is setting an environment variable.  This step, a <code>Shell Script</code>, fails on the following script: </p>
  
  <pre><code>export NODE_CONFIG_DIR= node_modules/test-automation-common/config
  </code></pre>
  
  <p>with a working directory of <code>$(build.SourcesDirectory)/specmapper</code>. </p>
  
  <p>I am part of team that uses a shared private agent on a local Macbook Pro. I'm not sure of the exact OS it is running, but I know it's only a year or two old. </p>
  
  <p>I'm trying to figure out how to set an environment variable on this machine. The machine is setup with a bash environment so the following should work: </p>
  
  <ul>
  <li>export VARNAME=stringofthingyouwant</li>
  </ul>
  
  <p>Due to a diligence of security, I cannot remote into the machine. I have been assured that export should be setup. </p>
  
  <p>I am trying to run automated tests using Protractor and I need to setup a config directory variable that is not available until after <code>npm install</code> has been run, so I cannot use the export section in the 'runsvc.sh' as recommended <a href="https://stackoverflow.com/questions/37890362/android-home-not-set-vsts-agent-running-as-service-on-os-x">here</a>.</p>
  
  <hr>
  
  <p><strong>Edit:</strong> I was previously trying to use the command line step on a mac, which was now obviously not going to work.  I mistook command line == terminal.  I now have a <code>Shell Script</code> as noted above. </p>
  
  <p>I am trying to run a build on TFS. One of the steps is setting an environment variable. This step (command line) fails with the message: </p>
  
  <pre><code>Failed which: Not found export: null
  undefined failed with error: Failed which: Not found export: null
  </code></pre>