title: How can you export all the variables in a file you use source on?
body: <p>I have 2 files at the moment that is 1 too many.  I have a file named <code>../environment</code> that is included into my service descriptions for systemd.  Then I have a<code> postactivate</code> file that virtualenvwrapper will source for me after I activate a VENV.</p>
  <p>What I want is to source the <code>../environment</code> file from inside the <code>postactivate</code> file BUT systemd environment files can't include the word export and the sourced file needs export to do what needs to be done.  Is there any option I can use to export all variables defined in <code>../environment</code> so that I don't have to maintain two equivalent sets of variables in two different forms?</p>
  <p>Here is an example:</p>
  <p>../evironment</p>
  <pre><code>DB_NAME=foo
  </code></pre>
  <p>$VIRTUAL_ENV/bin/postactivate</p>
  <pre><code>export DB_NAME=foo
  </code></pre>
  <p>And I want:
  $VIRTUAL_ENV/bin/postactivate</p>
  <pre><code>set -export-all-variables
  source ../environment
  unset -export-all-variables
  </code></pre>
  <p>Ignoring for a moment the pathing issues, is there some option I haven't found in bash to do what I'm asking?</p>
  <p>Also vscode doesn't want the export statements either so I'd really like to collapse this down to 1 file</p>
  <p>I guess my other option would be something like <code>eval $(sed s//export / ../environment)</code></p>